Me.Form.Caption is blank

M

MartinL

Hi ,

I am opening a form from a Command button in the Switchboard, and based on
which button is clicked I can open 2 different tables which have the same
fields using one single form. This is based on the following code that was
recommended on this forum.

Dim stDocName as String

stDocName = "TablesForm"
DoCmd.OpenForm stDocName
Forms!YourForm.RecordSource = "Employee1"

So I have this working and I am also sending the Tables number when I call
the
form by using the following which works just fine.

Forms!FormTabless.Caption = "Employee1"

When the form window opens it says "Microsoft Access - Employee1â€.

My only question once the form is open I would also like to be able to
use this value (Employee1) for another calculation I need to do. How can I
get
this value once the form opens? I tried to using the form.caption but all I
get is a blank using the following:

MsgBox ("caption=" & Me.Form.Caption)

Is there any other way of accessing this value? . . .

I am very much aware that it is not recommendable to have 2 separate tables
with the same design but due to an internal procedure we must have them
separated that way.

Thanks in advance.
ML
 

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