Datasheet subform

P

Peter Lux

I'm pretty new to Access, but not to db programming. I'm trying to display
records for a customer based on the customer job. I have 2 combo boxes,
customer and job, and then want all the tickets (in the sale and sale_item
tables) based on those 2 criteria. I have the subform, but I don't know how
to link it to the combo boxes since I'm not sure how to set the source on
the subform to a query like I did on the combo boxes.

I must not be looking in the right spot for this info, it seems like a
pretty simple operation to me.
Thanks in advance..
 
P

Peter Lux

I have the subform, but I don't know how
to link it to the combo boxes since I'm not sure how to set the source on
the subform to a query like I did on the combo boxes.

OK.. got the subform to open with the right query. When I open it with just
the subform, it asks me for the 2 parameters (in a standard
[forms]![form1]![cust_id].. value dialog] and populates just fine. However,
if I open up the form in form view, it doesn't work. Is there something
wrong with the combo boxes?
 
G

Guest

Peter, may be you would get some idea on seeing the thread with this title -
"Populating datasheet using search criteria"
by me(anand vaidya)
 
P

Peter Lux

if I open up the form in form view, it doesn't work. Is there something
wrong with the combo boxes?


I managed to find out what was wrong with the grid not populating.. the 2nd
combo box wasn't selecting the name, rather the key for that name. As soon
as I switched the bound column I got data!

But now something really weird is happening. The first combo selects all
customers with a quote in the system. It was working fine. I get data, but I
can't select anything. I've stared at the properties till I'm blue, what's
up? The list populates but I can't change the customer. I do have some code
to populate that fires after I select the customer, could that require an
adjustment? Like I said, it was working fine.. I might have changed a
property, but now I can't remember which one. The code is:

Private Sub Combo0_AfterUpdate()
Me.Combo2 = Null
Me.Combo2.Requery
Me.Combo2 = Me.Combo2.ItemData(0)
MsgBox (Combo0.Value + "-" + Combo2.Value)
Me.Sale_subform.Requery
End Sub

Private Sub Form_Current()
MsgBox "Got this far"
Me.Combo2.Requery
Me.Sale_subform.Requery
End Sub

Private Sub Form_Load()
Me.Combo0 = Me.Combo0.ItemData(0)
Call Combo0_AfterUpdate
End Sub
 

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