R
Rajesh Nathani
Access 2000. I have a form in which I have a control
diagnosisID. I also have a command button on the form
that when clicked should open other forms depending on
the value in the diagnosisID. The type of control in the
underlying table is AutoNumber. I have so far worked out
the following code:
'---------------------------------------------------------
---
' cmdDetails_Click
'
'---------------------------------------------------------
---
Private Sub cmdDetails_Click()
On Error GoTo cmdDetails_Click_Err
If "[Forms]![frmFollowUpsubform]![diagnosis ID]= 6"
Then
DoCmd.OpenForm "frmHirschsprung's", , , ,
acFormEdit, acWindowNormal
Else
Exit Sub
End If
cmdDetails_Click_Err:
MsgBox Err.Number & vbCr & Err.Description
End Sub
This code however gives me a type mismatch error.
Appreciate any help
diagnosisID. I also have a command button on the form
that when clicked should open other forms depending on
the value in the diagnosisID. The type of control in the
underlying table is AutoNumber. I have so far worked out
the following code:
'---------------------------------------------------------
---
' cmdDetails_Click
'
'---------------------------------------------------------
---
Private Sub cmdDetails_Click()
On Error GoTo cmdDetails_Click_Err
If "[Forms]![frmFollowUpsubform]![diagnosis ID]= 6"
Then
DoCmd.OpenForm "frmHirschsprung's", , , ,
acFormEdit, acWindowNormal
Else
Exit Sub
End If
cmdDetails_Click_Err:
MsgBox Err.Number & vbCr & Err.Description
End Sub
This code however gives me a type mismatch error.
Appreciate any help