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!

Input ID Number to Pull Record in Subform

Status
Not open for further replies.

Elvis72

Technical User
Dec 6, 2007
211
US
I have done this before...its just been like 5 years.

I have a main form that gives project information.

Then I have a subform that shows the workers that are assigned to that project.

I want to input the worker id and have the rest of the fields populated from the original resume table.

Not clear on how to do this.

Let me know what else you need!~

Thanks!~
 
You may consider the DLookUp function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya Elvis72 . . .

. . . or you could use a recordset:
Code:
[blue]   Dim db As DAO.Database, rst As DAO.Recordset
   Dim SQL As String, Cri As String
   
   Set db = CurrentDb
   SQL = "SELECT * " & _
         "FROM TableName " & _
         "WHERE [IDname] = " & Me![idName]
   Set rst = db.OpenRecordset(SQL, dbOpenDynaset)
   
   Me![[purple][b][i]Name1[/i][/b][/purple]] = rst![[purple][b][i]Name1[/i][/b][/purple]]
   Me![[purple][b][i]Name2[/i][/b][/purple]] = rst![[purple][b][i]Name2[/i][/b][/purple]]
   '
   Me![[purple][b][i]NameN[/i][/b][/purple]] = rst![[purple][b][i]NameN[/i][/b][/purple]]
   
   Set rst = Nothing
   Set db = Nothing[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
OK...trying the Dlookup at the moment and I have this:

DLookup("[First Name]", "[Last Name]", "[Worker ID] = Forms![ Plant Services Edit Entry form Staff Query]![Worker ID]")

BUT it is giving me a #Error Message?

Thanks!~
 
Getting a circular reference for control source message???
 
Well fixed that but still getting the #error message...??
 
Where you have [Last Name], shouldn't that be where you put the name of the table that [First Name] is located in? Do a separate DLookup for First Name and for Last Name in your subform.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top