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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Record 1

Status
Not open for further replies.

ITheadache

IS-IT--Management
Jun 13, 2006
45
US
Does anyone know how to get a record number in one form, and then being able to click a button that will allow me to open that exact record in another form?
 
Why not simply using the PrimaryKey ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yeah, thats what I was thinking, except I can't seem to get the search to happen correctly. The first form is one that has all of the data contained and listed for each record. The primary key is invoice.

The second form I just want to open it up, enter a specific invoice and have it return the proper sales information in the textboxes

Thanks
 
Have a look at the 4th argument of the DoCmd.OpenForm method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
ok, that makes sense, so lets say I am trying to open the record where the primary key equals the user input variable inv.

docmd.OpenForm "ShipSelection", acNormal, acEdit

This is where I get lost on what the proper syntax would be.
 
DoCmd.OpenForm "ShipSelection", acNormal, acEdit, "[name of PK field]='" & inv & "'"

IF the PK is defined as numeric then get rid of the single quotes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
DoCmd.OpenForm "ShipSelection", acNormal, acEdit, "Me.[Invoice #] =" & inv & ""

This code seems to getting closer, except when I enter this in it pops up a message box asking for the [me.invoice #] parameter, but then in the new pop form, it still pops up the first record of the table no matter what.
 
DoCmd.OpenForm "ShipSelection", acNormal, acEdit, "[Invoice #]=" & inv

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top