BarryMK
4 strings are enough
- Local time
- Today, 05:45
- Joined
- Oct 15, 2002
- Messages
- 1,349
Hello again, I hope
this is the last tiny wrinkle to smooth out of this database!
This code is placed in the LostFocus event of the only text field on the last of four stLinkCriteria linked popup forms, in order to refresh the data in the underlying table before previewing a report showing the current record.
After filling in the receipt number in Text Field "TextReceiptNo" the user then selects a Command Button which runs a macro to preview the report. (I'd rather use code here but the macro seems to work better so I'm sticking with it).
Everything works ok except it takes two clicks of the Command Button to preview the report. How can I get this down to one click please?
Code:
Private Sub TextReceiptNo_LostFocus()
Dim rs As String
rs = Forms!RecDetsAC!StrayRef
DoCmd.RunCommand acCmdSaveRecord
Forms!RecDetsAC.Requery
Forms!RecDetsAC!StrayRef.SetFocus
DoCmd.FindRecord rs
End Sub
Cheers Barry
This code is placed in the LostFocus event of the only text field on the last of four stLinkCriteria linked popup forms, in order to refresh the data in the underlying table before previewing a report showing the current record.
After filling in the receipt number in Text Field "TextReceiptNo" the user then selects a Command Button which runs a macro to preview the report. (I'd rather use code here but the macro seems to work better so I'm sticking with it).
Everything works ok except it takes two clicks of the Command Button to preview the report. How can I get this down to one click please?
Code:
Private Sub TextReceiptNo_LostFocus()
Dim rs As String
rs = Forms!RecDetsAC!StrayRef
DoCmd.RunCommand acCmdSaveRecord
Forms!RecDetsAC.Requery
Forms!RecDetsAC!StrayRef.SetFocus
DoCmd.FindRecord rs
End Sub
Cheers Barry