D
DocBrown
Ok, I'm trying to figure out how best to set the value of a field in a
secondary table based on the contents of a combo box linked to a field in the
primary table. Here's the critical setup.
Primary table (Events):
Field: Type:
ID (autonumber)
ProgArea Text
ProgID Number
..... [Other fields...]
Secondary table ProgList:
ProgID (autonumber)
ProgArea Text
ProgTitle Text
The form has controls tied as follows to the Events table
Control: Source: type:
ProgAreaBox ProgArea ComboBox
ProgTitleBox ProgID ComboBox
The ProgTitleBox list values are based on a Parameter query applied to the
ProgArea field of the ProgList Table filtered on the value in the ProgArea
Box. The combobox list is the ProgTitle field from the filtered values of the
ProgList Table. The ProgID of the selected ProgList record is saved in the
Events table.
So far so good.... Now I have a control that allows the user to open a form
where they can enter new values for ProgTitle. I only display the ProgTitle
field (again filtered on the ProgArea value).
The real question is: What are the options for automatically filling in the
value of the ProgArea field in the ProgList table? One way I found to work
was to put the following expression in the Default Value Property:
=[Forms]![Events].[ProgramArea Box]
But this seems like an odd way to use the Default Value property. I know for
sure I could do this in VBA code, but there was a time this happened without
VBA code, but now it's not doing it. I don't know what I changed in all my
development to make it stop working. Is there better place to use the above
experssion?
Any suggestions? Thanks in advance.
John
secondary table based on the contents of a combo box linked to a field in the
primary table. Here's the critical setup.
Primary table (Events):
Field: Type:
ID (autonumber)
ProgArea Text
ProgID Number
..... [Other fields...]
Secondary table ProgList:
ProgID (autonumber)
ProgArea Text
ProgTitle Text
The form has controls tied as follows to the Events table
Control: Source: type:
ProgAreaBox ProgArea ComboBox
ProgTitleBox ProgID ComboBox
The ProgTitleBox list values are based on a Parameter query applied to the
ProgArea field of the ProgList Table filtered on the value in the ProgArea
Box. The combobox list is the ProgTitle field from the filtered values of the
ProgList Table. The ProgID of the selected ProgList record is saved in the
Events table.
So far so good.... Now I have a control that allows the user to open a form
where they can enter new values for ProgTitle. I only display the ProgTitle
field (again filtered on the ProgArea value).
The real question is: What are the options for automatically filling in the
value of the ProgArea field in the ProgList table? One way I found to work
was to put the following expression in the Default Value Property:
=[Forms]![Events].[ProgramArea Box]
But this seems like an odd way to use the Default Value property. I know for
sure I could do this in VBA code, but there was a time this happened without
VBA code, but now it's not doing it. I don't know what I changed in all my
development to make it stop working. Is there better place to use the above
experssion?
Any suggestions? Thanks in advance.
John