W
Walter
I have a command button on a form to open another form to a specific record
to get some information. The form opens to the same incorrect record each
time no matter which record is called. I've checked the variables and all
are correct. Here is my code:
Dim stDocName As String
Dim intTrip As Integer
Dim stLinkCriteria As String
stDocName = "frmTrips"
intTrip = DLookup("TripID", "qryGetTrailerRepairMileage2")
stLinkCriteria = "[TripID]= " & intTrip
DoCmd.OpenForm stDocName, , , , acFormReadOnly, acDialog, stLinkCriteria
I also tried setting the value of an unbound text box and filtering to that.
The text box displayed the correct record number but the form still opened
to the same record.
What am I missing?
to get some information. The form opens to the same incorrect record each
time no matter which record is called. I've checked the variables and all
are correct. Here is my code:
Dim stDocName As String
Dim intTrip As Integer
Dim stLinkCriteria As String
stDocName = "frmTrips"
intTrip = DLookup("TripID", "qryGetTrailerRepairMileage2")
stLinkCriteria = "[TripID]= " & intTrip
DoCmd.OpenForm stDocName, , , , acFormReadOnly, acDialog, stLinkCriteria
I also tried setting the value of an unbound text box and filtering to that.
The text box displayed the correct record number but the form still opened
to the same record.
What am I missing?