RCheesley
Registered User.
- Local time
- Today, 18:35
- Joined
- Aug 12, 2008
- Messages
- 243
Hi all,
I (foolishly) took a dislike to the layout I had on a form, and decided to put a tabbed layout in its place. I copy/pasted the controls into the relevant pages, however now none of the VBA is working.
I'm assuming that I need to declare somewhere the information about the page it's now sitting on but where, and what syntax?
Here's an example of the code I have for a command button, which takes the NHS number entered in a text box and opens the relevant patient record:
Since moving it onto the tabbed-interface nothing happens when clicking on the button.
Ruth
I (foolishly) took a dislike to the layout I had on a form, and decided to put a tabbed layout in its place. I copy/pasted the controls into the relevant pages, however now none of the VBA is working.
I'm assuming that I need to declare somewhere the information about the page it's now sitting on but where, and what syntax?
Here's an example of the code I have for a command button, which takes the NHS number entered in a text box and opens the relevant patient record:
Code:
Private Sub cmdFindPatient_Click()
On Error GoTo Err_cmdFindPatient_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPatientDetailsWithTabs"
stLinkCriteria = "[PatientDetailsNHSNumber]=" & Me![TxtNHSNumberForSpecimen]
DoCmd.OpenForm stDocName, , , stLinkCriteria
[Forms]![frmPatientDetailsWithTabs].TabCtrl1.Pages(0).SetFocus
Exit_cmdFindPatient_Click:
Exit Sub
Err_cmdFindPatient_Click:
MsgBox Err.Description
Resume Exit_cmdFindPatient_Click
End Sub
Since moving it onto the tabbed-interface nothing happens when clicking on the button.
Ruth