Function on form open

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use a function to load label information in a form that is specific to the
client. I need the ClientID to use in the function.
When I put code on the Form Load event, I get an error because the value of
the ClientID is not yet loaded. I tried Form Activate, same problem. Where
can I put the code so that it fires after the form is loaded? This particular
form is bound.

Thanks!
 
Sam,

The On Current event will do the job. it will fire as soon as the first
record is loaded, as well as every time you move from one record to another.

HTH,
Nikos
 
Hi, Sam.

Put the code that calls the function in the Form_Open( ) event, since the
form's bound record source (and hence, the ClientID for the first record) is
available by the time this event fires. If you need this label to change for
every record (i.e., every record has a different ClientID), then put this
code in the Form_Current( ) event.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 
Back
Top