Append query

D

Deltic

I am using an append query (Query1)to add the name of the current
logged on user to a table using

Expr1: fGetFullNameOfLoggedUser()

I then have a text box on a form that displays the information
contained in the table.
All works fine if I run the query, whilst it is in design mode, and
adds the name as many times as i click on the red ! mark.
In my form I have under the On open an event procedure as shown below

Private Sub Form_Open(Cancel As Integer)

If fGetFullNameOfLoggedUser = "b******y paul" Then Command50.Visible =
True Command51.Visible = True End If



DoCmd.OpenQuery "Query1"

DoCmd.OpenForm "frm_shutdown", , , , , acHidden

End Sub

The problem is that the text box remains empty so the name of the
current user does not show, i know the query works from what i said
earleir, can anyone see where this newbie is messing up ?

Thanks in advance
 
N

NetworkTrade

You are appending the same record to which the form is opening?? then Query1
's append isn't complete in time. (Visually it seems to you that the form is
slower to open but that is kind of misleading...)

Figure out a way to make the Query1 happen before the form opens. Or
conversely show that text name after the form opens - maybe in a separate
popup form that opens with the first event inthe form....or there may be
other techniques...showing the name on the form and appending that name to a
table are separate issues...whereever you get that name for the query can be
used to get for the form via an unbound text box...
 

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