Oh man, I'm an idiot. I was unsetting the variables myself. I had a main form that was always open. So I unset the variables when it closed, to "log out" the user when they closed the database. But I recently reconfigured all the forms and now this form closes sometimes and unsets the variables...
I have been banging my head against the wall on this one.
I have a VBA function that get a users username and department. That function works fine. I have some code that needs to run when the DB is first opened so I used an autoexec macro that calls a VBA function:
public function db_open()...
Let me preface this by saying that the point of this excercise is to fix a databse with horrible data, and the keys are useless.
I didn't include the country because I wanted to get the uniwue individuals.
When I went and checked the value that was updated I saw what lameid was talking about...
I have two table tblA and tblB. tblB was made by selecting distinct First and Last name from tblA.
So tblB has 500 rows and tblA has 800 rows. Now I want to add the Country of birth to tblB with an update query joining tblA and tblB on first and last name.
Already you can see the conflict, there...
I have a Access 2010 database that is basically a front end for a MySQL database. There are some local queries and forms and VBA code. For some reason the database will only let one person use it at a time. I checked that the default open mode is not set to exclusive. I've never set anything to...
There are many ways to do this. This is the way I have used quite often.
Lets say your list box is call "partList".
Make the recordset for your datasheet a query if it not already. It should have a body parts column and then all the other columns you want.
Add this condition to the body...
So I am turning off full menus and the nav bar in my database to prevent users from mucking stuff up. But I am trying to make myself a backdoor so I can make changes.
I added this bit of code:
if user = "admin" then
CurrentDb.Properties("AllowFullMenus") = true...
I am saving my access database as a accde file to lock it down from users. Everything works fine, just how I wanted, but the icon for the file looks like the Access record locking file icon. Is that normal? I feel like users will be confused by that.
The frontend is an ACCDB file with the important tables living in a SQL Server DB connected via ODBC. As of now the users can open the forms in design view, but I will be working on disabling that.
I am doing something similar using the network login. user = Environ$("Username") to get the...
I just had an idea, that might just be a stroke of genius. I am working on a database that I want to have different levels or permissions. I want people to just use the forms and reports I create for them. These will only let you access certain things. All objects will be hidden in the...
Cool so your code is fine I just think you are trying to make the wrong thing visible. "Clock.Caption = Time" I think this means you have a Label control named 'Clock' that you want to make visible. So instead of 'Me.Visible' try 'Me.Clock.Visible'
What is "Me"? I think it is the form the button is on. Therefore it is already visible. Replace the line: 'Me.Visible = True' with "MsgBox Time()". Let me know what happens.
I have a feeling that you don't have any event calling the subroutine. Even though the subroutine is going to open a msgbox at a certain, something needs to trigger the subroutine to even check what time it is. Try putting this piece of code in the "OnCurrent" event of a form. Or on a button...
I like the tag idea. I could just tag controls as 'all' or 'admin' and hide appropriately. The data is in a backend SQL server db and is filtered down on the server-side using views, so that should keep the data secure. Thanks for the reply.
I am working on making a set of forms that will change depending on the privileges of the user. I can get the persons username then determine their privileges from a table. So how can I use that to hide certain forms or tabs if the person doesn't have the privilege to use them? e.x. if person is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.