continuous forms - populating unbound text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using continuous forms mode to display the SARs (Software Anomaly
Reports, and SCRs (Software Change Reports) related to an SS (Subcontractor
Submittal).

My form is bound to a table that stores the SS_ID, SAR_ID and SCR_ID. When
the form is opened for an SS_ID, it displays row(s) of SAR_ID(s) and
SCR_ID(s) for that SS_ID.

I would like to display the SCR Element by having an unbound text box in
each row that performs a lookup of the SCR_Element based on the SCR_ID. I am
using the following code which "works" but displays the same Element for ALL
SCRs (the Element of the first SCR_ID in the form):
Me.txtElement = DLookup("[SCR_Element]", "tblSCR", "[SCR_ID]='" & Me.SCR_ID
& "'")

Is there any way to to have the unbound text box look up the SCR Element for
the SCR_ID that is actually in that row?

Thank you for any help you can give me!
Judy
 
Instead of using the code
Me.txtElement = DLookup("[SCR_Element]", "tblSCR", "[SCR_ID]='" & Me.SCR_ID
& "'")

To set an unbound text box, and because it unbound it make te value the same
for all records, make that text box bound to the dlookup function, so in the
control source of the text box write

=DLookup("[SCR_Element]", "tblSCR", "[SCR_ID]='" & [SCR_ID] & "'")
 
Thank you very much. That is exactly what I needed!

Ofer Cohen said:
Instead of using the code
Me.txtElement = DLookup("[SCR_Element]", "tblSCR", "[SCR_ID]='" & Me.SCR_ID
& "'")

To set an unbound text box, and because it unbound it make te value the same
for all records, make that text box bound to the dlookup function, so in the
control source of the text box write

=DLookup("[SCR_Element]", "tblSCR", "[SCR_ID]='" & [SCR_ID] & "'")


--
Good Luck
BS"D


Judy Ward said:
I am using continuous forms mode to display the SARs (Software Anomaly
Reports, and SCRs (Software Change Reports) related to an SS (Subcontractor
Submittal).

My form is bound to a table that stores the SS_ID, SAR_ID and SCR_ID. When
the form is opened for an SS_ID, it displays row(s) of SAR_ID(s) and
SCR_ID(s) for that SS_ID.

I would like to display the SCR Element by having an unbound text box in
each row that performs a lookup of the SCR_Element based on the SCR_ID. I am
using the following code which "works" but displays the same Element for ALL
SCRs (the Element of the first SCR_ID in the form):
Me.txtElement = DLookup("[SCR_Element]", "tblSCR", "[SCR_ID]='" & Me.SCR_ID
& "'")

Is there any way to to have the unbound text box look up the SCR Element for
the SCR_ID that is actually in that row?

Thank you for any help you can give me!
Judy
 
Back
Top