dissapearing text

C

cinnie

I'm puzzled by something that I'm sure will be obvious to others.

I have a form (frmTask) with a textbox (txtTitle) having control source...
=Forms!frmMainMenu!txtTitle

Really, I'm just stealing the title from another open form. when it first
opens, frmTask has no records, just a set of comboboxes used to produce
records.

Here's my problem. When frmTask first opens, txtTitle is blank. Only when I
start to use the cbo's and records start appearing does the Title appear. By
stepping through code, I've noticed that the Title doesn't appear until
frmTask's Form_Current fires. How can I get it to appear as soon as the
frmTask opens? (I've tried Me!txtTitle.requery in the form's Open event to
no avail)

Thanks
 
L

Linq Adams via AccessMonster.com

Move your code from the control source to the Form_Load event for frmTask

Private Sub Form_Load()
Me.txtTitle = Forms!frmMainMenu!txtTitle
End Sub
 
C

cinnie

Thanks Linq - that works great!

As a learner, is there a reason why putting '= Forms!frmMainMenu!txtTitle'
in the textbox's Control Source doesn't work?

Have a happy new year
 

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