I tend to do that.
The items in the Acts and Regulations box are loaded from a single
data table. Each item in the list refers to a seperate table. In
this case when the item CAPS is selected from the first combobox, I
would like to have the records in the table called CAPS to be
loaded into the second combobox called "Section".
I hope this is a little bit clearer.
Z
:
You've confused me now. Why are you trying to load a table.?
I thought you had a form with a combobox named [Acts and
Regulations] and a second named (actually I don't know what it's
named but it contains Financial Regulations). You want to make a
selection in the Acts and Regulations combobox, that then restricts
the list of values to select in the second combobox.
Please explain how the tblCAPS comes in to play.
--
Joan Wild
Microsoft Access MVP
Zoltar54 wrote:
Joan,
Thanks once again. The code no longer gives me an error, however
it will not load the data in the tbl CAPS. As I am quite new at
the VBA and Access world perhaps I am missing something. The item
called tblCAPS - this is the taable I want loaded when a
particular Item is selected from the first combobox. Does this
need to defined (Dim) and if so what do I define it as
(recordset, access object etc..)
Z
:
ssql = "SELECT sectionID, actregID, section, description From
tblCAPS WHERE actregID= " & me.ActReg & " ORDER BY
section,description"
You have misplaced '&' and quotes.
--
Joan Wild
Microsoft Access MVP
Zoltar54 wrote:
Joan,
Thnaks for the tip. I have entered the code (using the names of
my objects) and it does not seem to work. Below is the code.
Can you provide some further insight?
Z
Dim ssql As String
ssql = "SELECT sectionID, actregID, section, description" &
"From tblCAPS WHERE actregID=&me.ActReg" & "ORDER BY
section,description"
Me.Sect.RowSource = ssql
:
See
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm
--
Joan Wild
Microsoft Access MVP
Zoltar54 wrote:
I am working with a databse that has 22 seperate tables. On
my form I have a combobox that is titled Acts and Regulations.
This combobox is populated with data from one table. When one
of the options is selected I would like to load a second
combobox with the corresponding date eg: when Financial
Tracking Regulations is selected I want the second combobox to
be populated by the table titled Financial Regulations.
Can someone help me with this?
Z