Link Combo box and form

M

maxine

Hi Guys,
I have a problem with my combo boxes
basically i have two filtering combo boxes which are working fine.
After selcting a vaule in the first combo box, a list of related items appear
in the second box. Based on what is selected on the first combo box, I have
created a form for each value in the second combo box.

The prolem i am having is linking the filtered combo box with the forms i
have made.
Beside the filtered combo box i created a button and placed the following
code in the on click area:


Private Sub Combo1_Click()

End Sub

Private Sub Command3_Click()
If IsNull(Me.Combo1) Then
MsgBox "Please select a query to view!"
Exit Sub
End If
DoCmd.OpenForm Me.Combo1
End Sub

Private Sub Command3_DblClick(Cancel As Integer)

The problem is that the code causes the filtering to stop in the combo boxes.
Is there other code that i could use to make my filtered combo box refer to
my forms?
 
M

maxine via AccessMonster.com

I tried to put the code into the after update of the combo box but it gave
the same result as when i had it on the on click of the button. The combo
boxes stop filtering . Any other suggestions?
 
G

Guest

I guess I don't fully understand your question. Descirbe what you mean by
the filtering stops.
 
M

maxine via AccessMonster.com

Ok i have worked on this and have got a partial soultion but its still not
correct.

I have inserted the code below into the onclick action of a command button to
open forms related to the combo box.

DoCmd.OpenForm Me.Product
In this way for example when the user selects fruit from the first combo box
a second combo box displays the list of fruits. The user then selects a
fruit and hits the open command button to open the related form.

The forms do open when the open button is hit but it also displays an
annoying error message that I cant stop. It says: "you didnt specify search
criteria with a find record action.
Given that the combo boxes are working and do open, i dont understand why
this also needs to appear. Any ideas?!!
 
G

Guest

Without the code to look at, I can't be sure; however, it appears you are
using a FindFirst, FindRecord, or something like that without telling Access
what to find. I tried to recreate the problem, but could not get that exact
message.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top