473,322 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Add record OnClose

I need to get hold on when, and more important which user last closed
this Access application (closed the mainform). This way I could have
the user that last time used the application to be the default value in
the combo box where the user is choosen upon next login.

Tried making a table containing the user data (Firma_ID) which can be
red from the mainforms textbox called txt_firma. Also, as a nice
feature I tried to get the date & time when every user last used the
aplikation as a information on the login-page (by having a date/time
field in the table with it's default value as now().

How would I get this new record to the table every time mainform is
closed? Tried append query without success, should probably been made
by code.

Nov 13 '05 #1
2 1459
Funone wrote:
I need to get hold on when, and more important which user last closed
this Access application (closed the mainform). This way I could have
the user that last time used the application to be the default value in
the combo box where the user is choosen upon next login.

Tried making a table containing the user data (Firma_ID) which can be
red from the mainforms textbox called txt_firma. Also, as a nice
feature I tried to get the date & time when every user last used the
aplikation as a information on the login-page (by having a date/time
field in the table with it's default value as now().

How would I get this new record to the table every time mainform is
closed? Tried append query without success, should probably been made
by code.


In the OnCLose event of the MainForm, copy the statement below. Change
the Table1 to your table name, and change UserName, TimeClosed to the
field names in your table.

Currentdb.Execute "Insert Into Table1 ([UserName], [TimeClosed]) Values
('" & CurrentUser & "', #" & Now() & "#)"

Nov 13 '05 #2
Thank you Salad for your answer! Got it working.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Douglas Buchanan | last post by:
This is a mystery! Why does the boolean value of a record change without my input. What follows describes the situation and the behavior. Table1: Field1: Text Field2: Yes/No Form1 has two...
3
by: David Altemir | last post by:
I have a button on "Form A" in the right margin of every record in my recordset. When you click on a button, a dialog box ("Form B") pops up that gives more details about that particular record. ...
2
by: amywolfie | last post by:
I have a series of 100 select queries (each represents a separate business rule). Each is run after a rule is tested. OnClose of each query, I need to run a report with only the results of...
6
by: Luke Matuszewski | last post by:
As in topic... has anyone used it ? I tried to use it but i guess i failed... here is a code: <html> <head> <title></title> <script type="text/javascript"> function closedWin() {...
2
by: Kaur | last post by:
Hi, I am working in MS Access 2000 and have created two forms. Form 1 is called frmParent (which has a subform called SfrmChild). FrmParent has a list box that lists all the Last Names of...
2
by: Tom_F | last post by:
To comp.databases.ms-access -- I would like to trigger an event when I close a form -- but ONLY when the data in the "RecordSource" table has been updated. I tried using the AfterUpdate event,...
2
by: ApexData | last post by:
I have a Single form with its RecordSource set to one table. This form will have only one record that is used for the application setup. I have UnBound TextBoxes on the form. The textboxes will...
8
by: lmurgas | last post by:
FormA = List of organization records bound to table FormB = Tabbed form with details of organization and all other related entities, such as orders, contacts, invoices, (all as subforms bound to...
10
by: kpfunf | last post by:
I have an OnClose function that opens a switchboard (SwitchOpen). This function is placed in numerous objects' (reports and forms) OnClose event, and works great. However, a very annoying...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.