473,499 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with global variables

hi ng

I got two huge problems:

1)
I have made a database that saves a users username a public variable when
the database opens.
When the database is shot down I wan't to save the time the user is leaving
the database, and in the "mainmenu form" I have made some vba under the
event: "shot down"

here it is:
Private sub form_close
Dim db As Database
Dim RSTOUT As Recordset
Dim strSQL As String

Set db = CurrentDb

strSQL = "select * from Tbl_BrugerLog"
Set RSTOUT = db.OpenRecordset(strSQL)

With RSTOUT
.AddNew
!Bruger = strUsername
!Tidspunkt = Now()
!Tekst = "Logger af"
.Update
End With
RSTOUT.Close

end sub

My problem is that it seems to reset the global variable just before it is
shotdown, so there is saved no name (the public variable is strUsername).

2) How do I hide the buttom in the right upper-corner that shot down the
database and access it selve?
Thanks in advance
Best regards
Henrik

Nov 12 '05 #1
2 2274
Henrik Thomsen wrote:

When the database is sh[u]t down I wan't to save the time the user is leaving
the database, and in the "mainmenu form" I have made some vba under the
event: "sh[u]t down"
Henrik, is the main form open throughout the session? If so, save the
user name on a text box on the form and make the text box visible
property false.

2) How do I hide the buttom in the right upper-corner that shot down the
database and access it selve?


As far as I know, you can't. If the user shuts down the database and
your main form is open, it will close first, firing its on close event.
That's the sort of thing I always use.

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Want some?" - Ditto
Nov 12 '05 #2
thanks alot Tim
"Tim Marshall" <tm******@Gunner.Sabot.Spam.On.Loaded.FIRE> skrev i en
meddelelse news:3F***************@Gunner.Sabot.Spam.On.Loaded .FIRE...
Henrik Thomsen wrote:

When the database is sh[u]t down I wan't to save the time the user is leaving the database, and in the "mainmenu form" I have made some vba under the
event: "sh[u]t down"


Henrik, is the main form open throughout the session? If so, save the
user name on a text box on the form and make the text box visible
property false.

2) How do I hide the buttom in the right upper-corner that shot down the
database and access it selve?


As far as I know, you can't. If the user shuts down the database and
your main form is open, it will close first, firing its on close event.
That's the sort of thing I always use.

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Want some?" - Ditto


Nov 12 '05 #3

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

Similar topics

3
2800
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
10
17823
by: Matt | last post by:
Greetings, What are people's thoughts on global variables in C++? Why are we taught not to use them in programming? Is it true that if you are running two copies of the C program one copy can...
4
24156
by: Andrew V. Romero | last post by:
I have been working on a function which makes it easier for me to pull variables from the URL. So far I have: <script language="JavaScript"> var variablesInUrl; var vArray = new Array(); ...
2
2158
by: Anand Subramanian | last post by:
Hi, Can someone explain the differences(setup, pre-main() setup/initialization) between global variables in a C++ and a C program? The global variables I used are uninitialized. I have a test.o...
2
5167
by: Bryan Parkoff | last post by:
….I would like to know which is the best optimization to use global variable or global struct. I always tell C/C++ Compiler to turn on optimization. ….I use underscore between first name and...
2
4426
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
4
2324
by: Harry | last post by:
Good Day, I am writing a code for the H.264 Video codec.I am using VC++ compiler,but programming is in c only.I have grouped the related global variables under one structure in a header file...
2
3131
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
3
1620
by: =?Utf-8?B?dGhlamFja29mYWxs?= | last post by:
I have a few global variables and a function that gets called multiple times to complete a single transaction and uses the variables. The function gets different notifications. When the function...
2
225
by: Anthony Kuhlman | last post by:
Pythoners, I'm having trouble understanding the behavior of global variables in a code I'm writing. I have a file, test.py, with the following contents foo = def goo(): global foo foo = ...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.