Form Problem narrowed down

B

Bryan Brassell

I have a ComboBox picking values from the correct table
for one field. I have the second ComboBox picking the
correct values for its list based on the choice in the
first ComboBox - see SQL below that populates the rows in
the second ComboBox:

SELECT Subcategory.Subcategory, Subcategory.Description
FROM Subcategory
WHERE (((Subcategory.Category)=[Forms]![JDEDATA]![FAFA4]));

However, once a choice is made in the first ComboBox, the
second populates and does not repopulate with a different
list if the first ComboBox is subsequently changed.

The FAFA4 is the first combobox's bound field (where the
value goes to) and has a field called Category which
matches an identical field named Category in the second
table for the second ComboBox.

I'm soooo close to solving this!!! Someone please save
me!!!!

Regards,

Bryan Brassell
 
B

Bryan Brassell

Thanks....

I am getting a syntax error when I add it - here is the
SQL from the first combobox - how exactly do I add the
requery line?

SELECT Category.Category, Category.Description
FROM Category;

-----Original Message-----
Bryan,
Requery the 2nd combo box after making a selection in the first.
Add
Combo2.Requery
on the line after the SQL code.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Bryan Brassell said:
I have a ComboBox picking values from the correct table
for one field. I have the second ComboBox picking the
correct values for its list based on the choice in the
first ComboBox - see SQL below that populates the rows in
the second ComboBox:

SELECT Subcategory.Subcategory, Subcategory.Description
FROM Subcategory
WHERE (((Subcategory.Category)=[Forms]![JDEDATA]! [FAFA4]));

However, once a choice is made in the first ComboBox, the
second populates and does not repopulate with a different
list if the first ComboBox is subsequently changed.

The FAFA4 is the first combobox's bound field (where the
value goes to) and has a field called Category which
matches an identical field named Category in the second
table for the second ComboBox.

I'm soooo close to solving this!!! Someone please save
me!!!!

Regards,

Bryan Brassell


.
 
B

Bryan Brassell

I went into VBA and put in this:

Private Sub FAFA4_Change()
FAFA5.Value = ""
FAFA5.Requery
End Sub

This has it working. Is that what you had in mind, or was
there an easier way? I could not get it to work in the
SQL code, only in VBA.

Thanks,

Bryan
-----Original Message-----
Bryan,
Requery the 2nd combo box after making a selection in the first.
Add
Combo2.Requery
on the line after the SQL code.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Bryan Brassell said:
I have a ComboBox picking values from the correct table
for one field. I have the second ComboBox picking the
correct values for its list based on the choice in the
first ComboBox - see SQL below that populates the rows in
the second ComboBox:

SELECT Subcategory.Subcategory, Subcategory.Description
FROM Subcategory
WHERE (((Subcategory.Category)=[Forms]![JDEDATA]! [FAFA4]));

However, once a choice is made in the first ComboBox, the
second populates and does not repopulate with a different
list if the first ComboBox is subsequently changed.

The FAFA4 is the first combobox's bound field (where the
value goes to) and has a field called Category which
matches an identical field named Category in the second
table for the second ComboBox.

I'm soooo close to solving this!!! Someone please save
me!!!!

Regards,

Bryan Brassell


.
 
F

Fredg

Bryan,
It's not part of the SQL.

SELECT Subcategory.Subcategory, Subcategory.Description
FROM Subcategory
WHERE (((Subcategory.Category)=[Forms]![JDEDATA]!
[FAFA4]));

Me!Combo2.Requery



--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Bryan Brassell said:
I went into VBA and put in this:

Private Sub FAFA4_Change()
FAFA5.Value = ""
FAFA5.Requery
End Sub

This has it working. Is that what you had in mind, or was
there an easier way? I could not get it to work in the
SQL code, only in VBA.

Thanks,

Bryan
-----Original Message-----
Bryan,
Requery the 2nd combo box after making a selection in the first.
Add
Combo2.Requery
on the line after the SQL code.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Bryan Brassell said:
I have a ComboBox picking values from the correct table
for one field. I have the second ComboBox picking the
correct values for its list based on the choice in the
first ComboBox - see SQL below that populates the rows in
the second ComboBox:

SELECT Subcategory.Subcategory, Subcategory.Description
FROM Subcategory
WHERE (((Subcategory.Category)=[Forms]![JDEDATA]! [FAFA4]));

However, once a choice is made in the first ComboBox, the
second populates and does not repopulate with a different
list if the first ComboBox is subsequently changed.

The FAFA4 is the first combobox's bound field (where the
value goes to) and has a field called Category which
matches an identical field named Category in the second
table for the second ComboBox.

I'm soooo close to solving this!!! Someone please save
me!!!!

Regards,

Bryan Brassell


.
 
P

Paul

It looks like you need to requery the second combo box
after you update the first one. In the "AfterUpdate" event
for the first combo try
Me.SecondCombo.Requery


HTH

Paul
 

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