listbox

kingsgambit

Registered User.
Local time
Today, 02:32
Joined
May 27, 2001
Messages
134
I have a listbox on ny form the user selects a topic fron the listbox and clciks a button which opens a form with the details of that topic, that works fine.
But if the user clicks the button before highlighting a topic from the list it opens a blank record.
Is there a piece of vb code that will check to see if a topic from the list has been highlighted
 
Take the code from the button and put it on the On click event for the list box and then delete the button. This way they can only open the second form by clicking on the list box.
 
Thanks, did not think of that
 
what is the code you use to open the forms/reports from your list box. Need to do the same thing.

Thanks
 
The code I used was a query code.
[Lastname]is a field in the listbox,
[cboname] is the listbox name
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmcontactview"
stLinkCriteria = "[LastName]=" & "'" & Me![cboname] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
 

Users who are viewing this thread

Back
Top Bottom