A
Anonymous
Hi,
Who can tell me what goes wrong in the following code ?
I am trying to program a check (comparison of data coming
from two different tables, of which one is linked) which
has to be performed when the NextButton is clicked, but
it's not working yet. I am new to this programming thing,
so any help is appreciated !
Private Sub Next_Click()
On Error GoTo Err_Next_Click
Dim stDocName As String
Dim stLinkCriteria As String
If [PatientLinked]![PATIENTID] <> [Patient]!
[PATIENTID] Then
MsgBox "PatienID is incorrect"
DoCmd.Close
Else
stDocName = "Subject number"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , ,
Me.Name
Me.Visible = False
End If
End If
Exit_Next_Click:
Exit Sub
Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click
End Sub
Who can tell me what goes wrong in the following code ?
I am trying to program a check (comparison of data coming
from two different tables, of which one is linked) which
has to be performed when the NextButton is clicked, but
it's not working yet. I am new to this programming thing,
so any help is appreciated !
Private Sub Next_Click()
On Error GoTo Err_Next_Click
Dim stDocName As String
Dim stLinkCriteria As String
If [PatientLinked]![PATIENTID] <> [Patient]!
[PATIENTID] Then
MsgBox "PatienID is incorrect"
DoCmd.Close
Else
stDocName = "Subject number"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , ,
Me.Name
Me.Visible = False
End If
End If
Exit_Next_Click:
Exit Sub
Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click
End Sub