G
Guest
Please excuse the double post but I need resolution to this annoying problem.
To help a user make corrections to previously entered data, I’ve given them
a form to enter a transaction key and click an OK button. This then takes
the user to yet another form, which displays the data they wish to correct.
The problem is that the user has to click the OK button twice to get the
data to display. The first time they click OK, the second form opens up and
the second time they click OK, the data appears. I used the button wizard to
build the code that opens the form. The code is as follows:
Private Sub butOpenfrmLeaveCorrection_Click()
On Error GoTo Err_butOpenfrmLeaveCorrection_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEmpLeaveCorrection"
stLinkCriteria = "[LeaveID]=" & Me![boxLID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_butOpenfrmLeaveCorrection_Click:
Exit Sub
Err_butOpenfrmLeaveCorrection_Click:
MsgBox Err.Description
Resume Exit_butOpenfrmLeaveCorrection_Click
End Sub
Why doesn't the second form open up with data the first time? What is the
way to get the second form’s data to display the first time the user clicks
the OK button.
tia,
To help a user make corrections to previously entered data, I’ve given them
a form to enter a transaction key and click an OK button. This then takes
the user to yet another form, which displays the data they wish to correct.
The problem is that the user has to click the OK button twice to get the
data to display. The first time they click OK, the second form opens up and
the second time they click OK, the data appears. I used the button wizard to
build the code that opens the form. The code is as follows:
Private Sub butOpenfrmLeaveCorrection_Click()
On Error GoTo Err_butOpenfrmLeaveCorrection_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEmpLeaveCorrection"
stLinkCriteria = "[LeaveID]=" & Me![boxLID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_butOpenfrmLeaveCorrection_Click:
Exit Sub
Err_butOpenfrmLeaveCorrection_Click:
MsgBox Err.Description
Resume Exit_butOpenfrmLeaveCorrection_Click
End Sub
Why doesn't the second form open up with data the first time? What is the
way to get the second form’s data to display the first time the user clicks
the OK button.
tia,