Changing of a caption?

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

Guest

Hello again,
Ok, is it possible to have the caption of a text box to change if different
selections on controls on a previous form are selected? For example, I have
a drop down with field values 1, 2, and 3. If 1 is selected, can I have the
caption to read "1", and if 2 was selected, read "2"... and so on... I would
need the text box to be blank as it will need to collect data on the next
form.
Thoughts? Thanks!
 
You can pass the field value in the OpenArgs argument of the OpenForm command
and then change your caption in the OnLoad event of the next form.
 
Hello, sorry, I am not understanding... also, I think I need to give more
information. I am using 2 forms and 2 tables. Form1 is gathering
information that will determine what the captions are on form2. Table1 one
holds the information for form1 and is only linked to table2 via one field,
Order_ID. Table1 has fields of A, B, and C that depending on what values are
in these fields (1 through 5 in each), will determine what the captions are
for the text boxes form2.

Using the DoCmd.OpenForm, I tried putting in the arguments, however, how are
they referenced with the onLoad?

Thanks!
 
Your 2nd form Load event will look something like:

Private Sub Form_Load()

Dim Args As Variant

If Not IsNull(Me.OpenArgs) Then
'-- Form is being opened from a form passing Label data
Args = Split(Me.OpenArgs, ";")
Me.Label1.Caption = Args(0)
End If

End Sub


Gary said:
Hello, sorry, I am not understanding... also, I think I need to give more
information. I am using 2 forms and 2 tables. Form1 is gathering
information that will determine what the captions are on form2. Table1 one
holds the information for form1 and is only linked to table2 via one field,
Order_ID. Table1 has fields of A, B, and C that depending on what values are
in these fields (1 through 5 in each), will determine what the captions are
for the text boxes form2.

Using the DoCmd.OpenForm, I tried putting in the arguments, however, how are
they referenced with the onLoad?

Thanks!
You can pass the field value in the OpenArgs argument of the OpenForm command
and then change your caption in the OnLoad event of the next form.
[quoted text clipped - 7 lines]
 
Thanks! That worked great!

ruralguy via AccessMonster.com said:
Your 2nd form Load event will look something like:

Private Sub Form_Load()

Dim Args As Variant

If Not IsNull(Me.OpenArgs) Then
'-- Form is being opened from a form passing Label data
Args = Split(Me.OpenArgs, ";")
Me.Label1.Caption = Args(0)
End If

End Sub


Gary said:
Hello, sorry, I am not understanding... also, I think I need to give more
information. I am using 2 forms and 2 tables. Form1 is gathering
information that will determine what the captions are on form2. Table1 one
holds the information for form1 and is only linked to table2 via one field,
Order_ID. Table1 has fields of A, B, and C that depending on what values are
in these fields (1 through 5 in each), will determine what the captions are
for the text boxes form2.

Using the DoCmd.OpenForm, I tried putting in the arguments, however, how are
they referenced with the onLoad?

Thanks!
You can pass the field value in the OpenArgs argument of the OpenForm command
and then change your caption in the OnLoad event of the next form.
[quoted text clipped - 7 lines]
form.
Thoughts? Thanks!

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 

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

Back
Top