Select response from dropdown in field1, populate both field1 & fi

N

navyraine

I've built a form ("training"), which is based primarily off of a table
("course"), and I'm running into problems with the subform.

Included in my course table is a field for courseCode and another for
courseName. Ideally, in the training subform I'd like to populate the
courseName field based upon the courseCode the user selects (from a drop
down).

For example, consider courseCode "B101" (courseName = "Intro to Business"),
I want the user to select "B101" from the drop down on my subform and then
have the courseName field automatically update to show the corresponding
courseName - in this case: "Intro to Business."

Is this possible? If so, how? (I keep running into "Enter Parameter Value"
errors).

Thanks kindly,
 
B

bhicks11 via AccessMonster.com

Yes. In the OnExit event of the combobox you can add a DLookUP() something
like this (example from some existing code I have):

Me.ISSUEDATE = DLookup("[ISSUEDATE]", "[TEST1]", "([SLNUM]= '" & Me.SLNUM &
"') And (
  • = '" & Me.List & "')And ([BEDTYPE]= '" & Me.AFTYPE & "')")


    Put your field names, criteria, etc. and it will populate whatever other
    control you want.

    Bonnie
    http://www.dataplus-svc.com
 
N

navyraine

Thanks, but unfortunately I'm not having any luck with this, which is
probably because I don't completely understand the syntax in the example (I
don't have a lot of Access experience).

Can you advise what the "Me." does or what it stands for? I thought it was
a table name, but that doesn't seem to work for me (i.e. I was trying
course.COURSENAME).

Also, I was assuming that everything between square brackets "[ ]" was a
field name, but can you correct me if I'm wrong?

Any extra advice is much appreciated. This problem is really putting the
brakes on my project!

Thanks!

bhicks11 via AccessMonster.com said:
Yes. In the OnExit event of the combobox you can add a DLookUP() something
like this (example from some existing code I have):

Me.ISSUEDATE = DLookup("[ISSUEDATE]", "[TEST1]", "([SLNUM]= '" & Me.SLNUM &
"') And (
  • = '" & Me.List & "')And ([BEDTYPE]= '" & Me.AFTYPE & "')")


    Put your field names, criteria, etc. and it will populate whatever other
    control you want.

    Bonnie
    http://www.dataplus-svc.com
    I've built a form ("training"), which is based primarily off of a table
    ("course"), and I'm running into problems with the subform.

    Included in my course table is a field for courseCode and another for
    courseName. Ideally, in the training subform I'd like to populate the
    courseName field based upon the courseCode the user selects (from a drop
    down).

    For example, consider courseCode "B101" (courseName = "Intro to Business"),
    I want the user to select "B101" from the drop down on my subform and then
    have the courseName field automatically update to show the corresponding
    courseName - in this case: "Intro to Business."

    Is this possible? If so, how? (I keep running into "Enter Parameter Value"
    errors).

    Thanks kindly,
 

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