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

Populate problem...

Status
Not open for further replies.

diverjess

IS-IT--Management
Sep 3, 2002
10
US
I am trying to populate a field in one form based on a field from a previous form. In other words, a specific record has a unique identifier in a text box on form one (an autonumber). When the user presses "Continue," that same number should populate the identifier text box of the following form (a number--not autonumber). However, when the user presses continue, the id does not pass from the first form to the second. The following displays how my code is set up...What can I do?

Private Sub Continue_Click()
On Error GoTo Err_Continue_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "nextform"

stLinkCriteria = "[identifier]=" & Me![identifier]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Continue_Click:
Exit Sub

Err_Continue_Click:
MsgBox Err.Description
Resume Exit_Continue_Click

End Sub
 
Save your record first. Autonumbers can be tricky in that they don't seem to truly exist until the record is saved.
 
Good idea, however the id still will not transfer from form one to form two. The text box for id in form two shows null, but the record is saving from form one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top