A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

creating a log file with MS Access



 
 
Thread Tools Display Modes
  #11  
Old November 24th, 2006, 05:23 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default creating a log file with MS Access

"snipersix" wrote in message
ups.com...
where do you place this code

INSERT INTO TableName (UserNameField, LoginTimeField)
VALUES(CurrentUser, Now())


That's not code. It's the SQL of an APPEND query.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #12  
Old November 24th, 2006, 05:46 PM posted to microsoft.public.access.gettingstarted
snipersix
external usenet poster
 
Posts: 13
Default creating a log file with MS Access

ok thank you very much for your help


Rick Brandt wrote:
"snipersix" wrote in message
ups.com...
where do you place this code

INSERT INTO TableName (UserNameField, LoginTimeField)
VALUES(CurrentUser, Now())


That's not code. It's the SQL of an APPEND query.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #13  
Old November 24th, 2006, 05:51 PM posted to microsoft.public.access.gettingstarted
snipersix
external usenet poster
 
Posts: 13
Default creating a log file with MS Access

i notice that this code
CurrentDB.Execute "QueryName", dbFailOnError

doesnt seem to work. I placed it in the VBA code of my splash screen,
it doesnt run the append query automatically. But my append query is
working fine if i do it manually. why is that so?

Rick Brandt wrote:
"snipersix" wrote in message
ups.com...
where do you place this code

INSERT INTO TableName (UserNameField, LoginTimeField)
VALUES(CurrentUser, Now())


That's not code. It's the SQL of an APPEND query.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #14  
Old November 24th, 2006, 06:01 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default creating a log file with MS Access

"snipersix" wrote in message
ups.com...
i notice that this code
CurrentDB.Execute "QueryName", dbFailOnError

doesnt seem to work. I placed it in the VBA code of my splash screen,
it doesnt run the append query automatically. But my append query is
working fine if i do it manually. why is that so?


What event did you use? It is not enough to just add code to a module. You
need an event handler that runs it.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #15  
Old November 24th, 2006, 06:15 PM posted to microsoft.public.access.gettingstarted
snipersix
external usenet poster
 
Posts: 13
Default creating a log file with MS Access

i used on load and pluged the code in. It gave me an error.


Rick Brandt wrote:
"snipersix" wrote in message
ups.com...
i notice that this code
CurrentDB.Execute "QueryName", dbFailOnError

doesnt seem to work. I placed it in the VBA code of my splash screen,
it doesnt run the append query automatically. But my append query is
working fine if i do it manually. why is that so?


What event did you use? It is not enough to just add code to a module. You
need an event handler that runs it.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #16  
Old November 24th, 2006, 06:18 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default creating a log file with MS Access

"snipersix" wrote in message
oups.com...
i used on load and pluged the code in. It gave me an error.


And the error was?

You did create a separate append query right?

You did replace "QueryName" in the code with the actual name of your append
query right?


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #17  
Old November 24th, 2006, 06:25 PM posted to microsoft.public.access.gettingstarted
snipersix
external usenet poster
 
Posts: 13
Default creating a log file with MS Access

yes i did. But everytime i run the splash screen, which contains the
code, the debugger shows up, highlighting

CurrentDB.Execute "QueryName", dbFailOnError

It gives a Run-time error '3078'

The Microsoft Jet database engine cannot find the input table or query
'QueryName'. Make sure it exists and that its name is spelled
correctly.


Rick Brandt wrote:
"snipersix" wrote in message
oups.com...
i used on load and pluged the code in. It gave me an error.


And the error was?

You did create a separate append query right?

You did replace "QueryName" in the code with the actual name of your append
query right?


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #18  
Old November 24th, 2006, 06:38 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default creating a log file with MS Access

"snipersix" wrote in message
oups.com...
yes i did. But everytime i run the splash screen, which contains the
code, the debugger shows up, highlighting

CurrentDB.Execute "QueryName", dbFailOnError

It gives a Run-time error '3078'

The Microsoft Jet database engine cannot find the input table or query
'QueryName'. Make sure it exists and that its name is spelled
correctly.


And you are quite sure that the query you made is named "QueryName"? That error
means pretty much exactly what it sounds like.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #19  
Old November 24th, 2006, 06:42 PM posted to microsoft.public.access.gettingstarted
snipersix
external usenet poster
 
Posts: 13
Default creating a log file with MS Access

im sorry i made a mistake the error was

Run-time Error '3061'

too few parameters. expected1

snipersix wrote:
yes i did. But everytime i run the splash screen, which contains the
code, the debugger shows up, highlighting

CurrentDB.Execute "QueryName", dbFailOnError

It gives a Run-time error '3078'

The Microsoft Jet database engine cannot find the input table or query
'QueryName'. Make sure it exists and that its name is spelled
correctly.


Rick Brandt wrote:
"snipersix" wrote in message
oups.com...
i used on load and pluged the code in. It gave me an error.


And the error was?

You did create a separate append query right?

You did replace "QueryName" in the code with the actual name of your append
query right?


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #20  
Old November 24th, 2006, 06:52 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default creating a log file with MS Access

"snipersix" wrote in message
oups.com...
im sorry i made a mistake the error was

Run-time Error '3061'

too few parameters. expected1


Post the SQL of your query.


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.