Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

manipulate text in form caption 1

Status
Not open for further replies.

installer69

Programmer
Sep 18, 2004
35
GB
I want to vary the contents of form Bs title caption depending on what is entered in a text box on form A that leads to form B. Any idea?
 
AfterUpdate - me.caption = "Whatever you feel like"

DoCmd.OpenForm "Frm_WhateverItIs"
Forms!Frm_WhateverItIs.Caption = "La la la la " & me.fieldname

I also include a record count in my captions i.e. (Record 7 of 70) which is a nice feature.

Hope this helps

I haven't failed, I have just found 10,000 ways that it won't work!
 
but how do i set "whatever you feel like" as = Forms![stock status]![status]
 
In Form A's Text Box enter a value (let's say the value is 10, denoting the number of items in stock in stock). Now we call Form B. Form A's Text box for this example is called TxtStock.

DoCmd.OpenForm "FormB"
FormB.Caption = "You have " & me.TxtStock & " items in stock"

The above example will display in the caption how many items are in stock for the item on Form A - e.g. "You have 10 items in stock"

Hope this is clearer

I haven't failed, I have just found 10,000 ways that it won't work!
 
Still can't get it to work. Txtbox saying 'object required' comes up when form b loads
 
Interesting! I wonder why? When I call a form using the docmd.openform function, I often caption called form with a field from the opening form. The called form is opened in dialog mode so that the source form remains open and the form can therefore be referenced. Is your source form closed? This might be your problem.

If you do close the form you can pass the required field value to the called form and use this field in your caption.

I haven't failed, I have just found 10,000 ways that it won't work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top