R
RobUCSD via AccessMonster.com
In my table, tblPtDemograhpics, I changed the MRN (Medical Record Number)
field to txt in the table where the MRN resides. Originally it was a number
field. But then I implemented a check sum routine on MRN and it doesn't work
w/o the MRN being text as some of the MRN's have leading zeros.
Now I can't get the form to load a new patient. Think it's my syntax in the,
stLinkCriteria = "[MRN]=" & Me![MRN] piece of the code. I'm probably now
refering to MRN correctly, this was the way it was set up when MRN was a
number field, and it worked then.
If somebody could take a look I'd really appreciate it. Thanks, Rob
************************************************************************************************************
Private Sub cmdNewPtLoad_Click()
Dim stDocName As String
Dim stLinkCriteria As String
On Error GoTo cmdNewPtLoad_Click_Error
DoCmd.RunCommand acCmdSaveRecord
stDocName = "frmPtDemographicNew"
stLinkCriteria = "[MRN]=" & Me![MRN]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmNewPt"
On Error GoTo 0
Exit Sub
cmdNewPtLoad_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
cmdNewPtLoad_Click of VBA Document Form_frmNewPt"
End Sub
field to txt in the table where the MRN resides. Originally it was a number
field. But then I implemented a check sum routine on MRN and it doesn't work
w/o the MRN being text as some of the MRN's have leading zeros.
Now I can't get the form to load a new patient. Think it's my syntax in the,
stLinkCriteria = "[MRN]=" & Me![MRN] piece of the code. I'm probably now
refering to MRN correctly, this was the way it was set up when MRN was a
number field, and it worked then.
If somebody could take a look I'd really appreciate it. Thanks, Rob
************************************************************************************************************
Private Sub cmdNewPtLoad_Click()
Dim stDocName As String
Dim stLinkCriteria As String
On Error GoTo cmdNewPtLoad_Click_Error
DoCmd.RunCommand acCmdSaveRecord
stDocName = "frmPtDemographicNew"
stLinkCriteria = "[MRN]=" & Me![MRN]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmNewPt"
On Error GoTo 0
Exit Sub
cmdNewPtLoad_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
cmdNewPtLoad_Click of VBA Document Form_frmNewPt"
End Sub