Openform action cancelled

tezread

Registered User.
Local time
Today, 07:12
Joined
Jan 26, 2010
Messages
330
This is most strange as it was working before! I have a search function form but when I click a button 'View patient discussion' to view the record based on a list box item I get the openform action cancelled error message.

The form that is supposed to open is frmPatient and obviously it is supposed to jump to that specific patient

see attached for demo

thanks in advance guys
 

Attachments

I get a 'datatype mismatch in criteria expression' in the Command60_Click() event handler in FRM_SearchMulti at the line ...
Code:
DoCmd.OpenForm stDocName, , , stLinkCriteria
The problem appears to be that your stLinkCriteria evaluates to ...
Code:
[PatientID]="Bill"
... but the PatientID field in the RecordSource of frmPatient, which is your stDocName, is a Long Integer.
Before opening frmPatient to a specific patient it'd be easiest to have the PatientID available to the calling code.
HTH
 
lagbolt is right, plus the fact that you didn't have PatientID as a field in your listbox's Row Source. Here's the amended version.
 

Attachments

Users who are viewing this thread

Back
Top Bottom