Applying this listbox to my DB.

Zorkmid

Registered User.
Local time
Today, 18:03
Joined
Mar 3, 2009
Messages
188
Hi there.

I found this example somewhere (see attachment search multiple fields.zip) and thought it would be great for my DB.

I have a list box set up in my database's startup form that displays all of the open cases (child records that have a null value in the enddate field). I want to display fields such as "Unit" "FirstName" and "LastName" "Isolationtype" and so on, so that the user can easily identify which record they want to get into to close. The example doesnt show a parent child db setup, and I'm not sure how to reference it in row sources to get the relavant information in there. Any ideas?

-Z
 

Attachments

Have a look at the query QRY_PatientAllDtls that I've added I think it does what you are looking for.
 

Attachments

Thanks very much!

-Z
 
Now I'm having trouble trying to get the dbl click function working. I've built a form identical to "frmlookup" but plan to lock out all of the controls except for "End Date" and EndReason.

Whenever I double click one of the displayed records, I get the error "microsoft jet doesnt recognize 'k123' as a valid field name or expression. Which is strange becuase that k123 isnt a field name its a field value.

I also get the error "data type mismatch in criteria expression"
 

Attachments

Hmmm, it also doesnt seem to be opening the correct record, and it leaves the child record part blank....
 
Try the following in your Double Click event;

Code:
Dim stDocName As String
Dim stLinkCriteria As String

    
stDocName = "frmOpenCaseLookup"
    
stLinkCriteria = "[PatientKNum]=" & "'" & Me![SearchList] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
    
DoCmd.Close acForm, Me.Name
 
Try the following in your Double Click event;

Code:
Dim stDocName As String
Dim stLinkCriteria As String
 
 
stDocName = "frmOpenCaseLookup"
 
stLinkCriteria = "[PatientKNum]=" & "'" & Me![SearchList] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
DoCmd.Close acForm, Me.Name

This seems to bring me to a completely blank form. It's the correct form when you switch to design view, but in form view is completely blank. Can't see any labels or controls or anything.

-Z
 
Try the following in your Double Click event;

Code:
Dim stDocName As String
Dim stLinkCriteria As String
 
 
stDocName = "frmOpenCaseLookup"
 
stLinkCriteria = "[PatientKNum]=" & "'" & Me![SearchList] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
DoCmd.Close acForm, Me.Name

THis code seems to open to a blank page. Its the correct form and shows up in design view, but the page is blank when you look at it in form view. hmm.

-Z
 
I checked that code yesterday in your DB before posting and again this morning I downloaded your DB and pasted the code into the Double click event for the Listbox.

It worked fine on both occasions. However I did notice both times that on double click I would,first, get a message saying that the system could not find MouseHook.dll that may well be interfering with the correct operation of the code on your computer.
 

Attachments

Users who are viewing this thread

Back
Top Bottom