P
Paul
Hello list,
I am creating a Model Railroad inventory database and I
have hit a brick wall.
I am trying to get the Railroad name to automatically
appear in a text box when I select its reporting marks.
Here is what I have.
I have a table called Reporting Marks. It has three
columns, RailroadId (Primary Key, auto number),
ReportMarks (Railroad Reporting Marks) and RoadName
(Railroad Name). All but the primary key field are text
fields. I also have a form to use to add more Railroads
as I need them. This table and form work just fine.
I have another form with an unbound text box named
Text48, and a combo box called Repmark. What I want to
happen is when I select a reporting mark in the combo
box, have the railroad name associated with it appear in
the text box automatically. I have an event programmed
into the After Updates event for the text box. The code
for this is:
Private Sub Text48_AfterUpdate()
Dim varRn As Variant
varRn = DLookup_
("Roadname", "Reporting_Marks", "ReportMarks")
Me![Text48] = varRn
End Sub
What I want to happen is when I select a Reporting Mark,
I want the Railroad associated with that Reporting mark
to come up in the text box. So far all I can get is the
first railroad name in the list comes up no matter what
reporting mark field I select.
Any help wouild be greatly appreciated. I have been
beating myself up with this for a couple of days now and
I can't get it to work.
Thanks in advance.
Paul
I am creating a Model Railroad inventory database and I
have hit a brick wall.
I am trying to get the Railroad name to automatically
appear in a text box when I select its reporting marks.
Here is what I have.
I have a table called Reporting Marks. It has three
columns, RailroadId (Primary Key, auto number),
ReportMarks (Railroad Reporting Marks) and RoadName
(Railroad Name). All but the primary key field are text
fields. I also have a form to use to add more Railroads
as I need them. This table and form work just fine.
I have another form with an unbound text box named
Text48, and a combo box called Repmark. What I want to
happen is when I select a reporting mark in the combo
box, have the railroad name associated with it appear in
the text box automatically. I have an event programmed
into the After Updates event for the text box. The code
for this is:
Private Sub Text48_AfterUpdate()
Dim varRn As Variant
varRn = DLookup_
("Roadname", "Reporting_Marks", "ReportMarks")
Me![Text48] = varRn
End Sub
What I want to happen is when I select a Reporting Mark,
I want the Railroad associated with that Reporting mark
to come up in the text box. So far all I can get is the
first railroad name in the list comes up no matter what
reporting mark field I select.
Any help wouild be greatly appreciated. I have been
beating myself up with this for a couple of days now and
I can't get it to work.
Thanks in advance.
Paul