dynamically change form title with VB script Follow

0
Avatar
David Willms

I'd like to change the title of a form during the OnOpen event with a VB Script. Something like

Form1.title = Format.BaseName + " - choose a record"

, but this always returns an error saying the 'Form1' object is required. Can the form be referenced in this way?

Any ideas?

Dave

 

4 comments

0
Avatar
adam cummick
Comment actions Permalink

I'm pretty sure you can't write to these properties in bartender VBA unfortunately. A workaround I've done is:

1. Create a named data source that is connected to the name you want(database, script, etc.). You can add a second embedded text source to the named source for the " - choose a record"

2. Drag that source onto your form as a text input box. Set it as read only, turn off scroll bars, etc to make it basically look like a normal text box.

This should update on the form whenever the named source is updated

 

0
Avatar
David Willms
Comment actions Permalink

Well, that's too bad. :( 

I notice one can't change textbox text with VB either.

Your suggested work-around is a good idea. I have a hard time making a text input box look just like the background, and it still takes the focus when the user tabs through the form, but it works acceptably well.

Thanks!

Dave

0
Avatar
adam cummick
Comment actions Permalink

Yeah, I think the closest you can get to the background is making it "Read only" Which grays it out some. If you go to the data entry tab for the text box, you can exclude that box from the tab control order. (Checkbox in focus behaviour section)

0
Avatar
David Willms
Comment actions Permalink

Now I see "exclude from tab order" - thanks again.

Dave

PS I've sandwiched the "labelname" input box between a record picker and the line separating the Print and Cancel and run it off the sides of the form so it looks pretty innocuous. 

 

Please sign in to leave a comment.