Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populate form field based on one record in table - ???

Status
Not open for further replies.

wendyd

Programmer
Jun 5, 2001
8
US
I've got a table which has one record. I need to fill a form text box with the value of one field in the record. I won't know the id of the record since that might change so I don't have anything to search on.

Help please!?!

Thanks!
 
Try setting the rowsource of the text box to a SQL statement like this.

"SELECT " & strColumn & " FROM tablename WHERE "& strColumn & " = '" & strCriteria & "';"

I can't tell for sure what you are wanting to do but this will let you select which column to search through and what to search for. If this ins't what your needing.. give me a little more info about what you are doing. How is the id going to chang, etc. -Dustin
Rom 8:28
 
Dustin,

Thanks for your suggestion. What I'm doing is inserting a name into a field on a form. The name comes from a table which has one record.

This database is being distributed to 300 sales people. They will personalize their copy of the database by entering their info. They have different employee numbers (which will be the ID).

Maybe I could use a wildcard to search the field?

Thanks!
 
Okay, let me see if I get this.. are you trying to search through all the columns for that particular ID number? I'm still not really seeing it all. I'm not extremely skilled in SQL, you can check out and get the basics of what I know. I'll try to help you though if I can ever understand what you need :). -Dustin
Rom 8:28
 
Justin,

I could search through all columns for that particular ID and retrieve the data I need.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top