April 29, 2009 at 1:10 pm
I have an add-entry form which updates a table for payroll. It has a combo box on it which lists JobName & its associated Job-ID from another table.
When a Job is selected from that list on the form I want it to save both the JobName and the Job-ID in the payroll table - It only manages to save one or the other not both.
Can I correct this somehow.
Thanks
April 29, 2009 at 1:22 pm
You'd have to have a column in the drop-down that has both values in one column. Access forms can't bind a control to two columsn of data.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 16, 2009 at 10:07 am
You wouldn't normally do that, because in a relational database you would write your query to look up the job name from that other table using the ID. What you suggest breaks one of the rules of normalization (I forget which one).
But if you can't change the design, you could try this:
Add the job name on the form and set Visible = No, then in the AfterUpdate event of the combo box you would use this:
Me!MyJobName = Me!MyComboBox.Column(1)
which pulls the 2nd column from the combo box into the job name field.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply