Change Caption by code - problem

J

jhweb_online

I have this database with a main form. This database application
manages several underlying klients. I have a button that's labeled
"Change user" which pops up a normal little form where one chooses a
new user from a combo box. Everything works ok but I'm having troubles
getting part of the Caption of this main form to change. If I start the
application and choose the user then the users name becomes a part of
the caption as desired. But if I try to switch user as described
earlier then the caption doesn't change.
The code:

Private Sub Form_Activate()
Me.Caption = "Bla bla bla [ " & DLookup("[tbl_name]", "namn") & " ]"
Me.Refresh
End Sub

Tried with Me.Requery but the caption won't update as expected. Any
help would be soo nice.
 
S

Steve Huff

Try placing the code in the Enter event of the comobox where you select the
user. I believe the problem you are seeing is the fact the Activate event
is not getting fired when the change users.
 

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