I read in MS documentation that it is in breach not to display the runtime text "powered by Microsoft access runtime" and the associated logo.
In one of my apps, I needed to hide the window so read in depth what I could get away with. I placed the text and logo onto my form this still displaying what I should be displaying.
Not only do I hide my window, it's completely hidden from everyone and I placed a systray icon with options
I am a bit confuse of where to place your code. I have other VBA around my database and I don't wan to mess it up. Can you give me the idea of where each of this codes goes in events?
Although I have made my main from popup and sloats around the screen, if I click the minimise button on the application window it also minimizes my form?
Sorry forgot you were using 64-bit Access - very few people do so.
I've just updated the APIs to work with 64-bit & checked it runs OK here
I used Access 2016 64-bit
New version attached
On the highly unlikely event you still have problems, open holding down the Shift key & check you have no references marked as MISSING due to dropping from 2016 on my PC to 2013 on yours
I tried using the code you supplied, but I keep getting this error:
"The expression On Load you entered as the event property setting produced error: Only comments may appear after End Sub, End Function, or End Property"
I was wondering if you could help me. I apologize I am a NOOB when it comes to VB. I have created a login form that I want to show as a pop-up with no background but the desktop. This is the code I have so far. I feel like it is a simple fix. Any help is much appreciated.
Option Compare Database
Private Sub Form_Load()
DoCmd.ShowToolbar "Ribbon", acToolbarNo
End Sub
Private Sub Command1_Click()
Dim UserLevel As String
If IsNull(Me.txtLoginID) Then
MsgBox "Please enter LoginID", vbInformation, "LoginID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please enter password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'process the job
If (IsNull(DLookup("[UserLogin]", "tblUser", "[Userlogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect LoginID or Password"
If you're having trouble with hiding the window, have you tried my version - link in post #46
Its slightly different to what Nigel Shaw posted
Also, a quick scan of your code shows errors in the If ..End If section
There are 2 Else statements as well as an ElseIf
IF you need both then change the first to ElseIf as well
Code:
If ...
ElseIf ...
ElseIf ...
Else
End If
I haven't looked at the full code so its possible there are other errors.
That first section of code goes in your form code module.
The second section of code needs to be moved to a separate 'standard' module.
NOTE
Allways add the line Option Explicit at the top of each module under Option Compare Database
It will ensure all variables are correctly defined in your code
Your version is exactly what I am looking for. I tried incorporating your modules
into my Login Form, but it did not work for me. I have included screen shots. I also looked at the Else statements and I was not sure which one did not belong. I got this code from another user. The login form does work. Can you give me some more insight? Any help you can give me is very much appreciated.
Can you zip and upload your db.
Remove most of the data leaving a couple of modified records so I can login.
Make sure you tell me a userid & password combination!
OK - this is what I've done so far.
I've taken a few liberties but you can reverse things you don't like
1. Added missing reference - Microsoft Visual Basic for Applications Extensibility - needed so that it compiles!
2. Added missing line in Form_Load event of the Login Form
Code:
SetAccessWindow (SW_SHOWMINIMIZED)
3. Indented the code on your Command1_Click event so I could check it.
In fact the number of If ...Else... End Ifs are fine but the code isn't very neat.
I'll leave that to you however.
I recommend you name your buttons something meaningful like cmdOK / cmdCancel
4. The Login Form now floats on the desktop as you require.
However, the Access window flashes briefly first
There are ways around that.
The easiest is to open the database with a shortcut and set that to run Minimised. I've included that in the zip file - you'll need to alter the path ...
5. If the user clicks Cancel, the database should close - I've altered the code to do that:
Code:
Application.Quit
6. After clicking OK, I get an irritating message "Entry has been approved".
I suggest you get rid of that and go straight to the next form.
I've disabled it for now
7. When the Navigation form opens, the Access window will appear.
If you don't want that, you'll need to alter the code further
NOTE:
It is a breach of Access runtime conditions to hide the Access window ... or more accurately you should have this wording visible 'Powered by Microsoft Access'
It should be fine to ignore this for a login form but if you intend to hide the Access window completely whilst the db is open, I'd add the phrase in small letters somewhere on the main form used
Finally, clicking on the taskbar icon will cause the Access window to reappear.
Its not possible to prevent this UNLESS you also hide the taskbar icon as well.
That's possible but I really don't recommend it.
I tried using the code you supplied, but I keep getting this error:
"The expression On Load you entered as the event property setting produced error: Only comments may appear after End Sub, End Function, or End Property"
I was wondering if you could help me. I apologize I am a NOOB when it comes to VB. I have created a login form that I want to show as a pop-up with no background but the desktop. This is the code I have so far. I feel like it is a simple fix. Any help is much appreciated.
You won't know me as I only joined in Feb of this year after lurking as a guest since around 2001.
I've seen some of your old posts but noticed you had been missing for a while.
Yesterday Bob Larson reappeared after 4 years or so ...
Something's in the air
Anyway, just to say I posted a similar solution a few months back to the code repository.
I hadn't seen yours at the time.
Your code looks similar to that on Phil Stiefel's website at www.codekabinett.com
Is it the same source?
@ Ridders
I really appreciate the help Ridders... I tried the .zip file you attached, but it is still doing the same thing. Is it this the correct file?
@Ridders Thanks again for the help. It works really good. I actually added the ENTRY MESSAGE but it is ok, that you disabled it. How do I enable again if decide later on to activate it again? I erased the "CR - disabled" code after the message but it continued not to show when I entered the correct user and password.
No i havent seen that site before. Mine was a bit of a frankensteins monster if im honest. I have written some code then found some code that nearly did what i wanted so i merged them together and got my result. Mine includes a minimize to the systray which is where it originally came from.
I want to upload my full original splashbuilder tool that i wrote the code for into the repository but at 13mb, im not allowed. Any suggestions?. The tool uses the methods but also allows you to create a splash screen and add it to your existing database. it will set up everything and create a shortcut on the desktop. Run the shortcut and your app will open without the Access Window. See video for reference.
I had intended to make this a tool to sell but with work commitments etc etc, i fell by the wayside and eventually got shelved.
I hope you can get some use out of it, there are some good code examples in there for various things, I only ask that you credit me with any of my code used.