Need help with Form

sjslall

Registered User.
Local time
Yesterday, 23:55
Joined
Oct 21, 2010
Messages
34
I have created a remote database access application.
I have configured from Access Options to load the form1 as the Home Screen.
This screen has 3 command buttons which when clicked should open their respective forms.

I need assistance with the following:

When the appl (accde) is launched, is it possible only the home-screen form loads without the Access 2007 ribbon and the navigation pane.

User selects their respective screen and the home screen should give way to the selected form.

Also is it possible to have the home screen show the user's windows login name.
 
I have created a remote database access application.
I have configured from Access Options to load the form1 as the Home Screen.
This screen has 3 command buttons which when clicked should open their respective forms.

I need assistance with the following:

When the appl (accde) is launched, is it possible only the home-screen form loads without the Access 2007 ribbon and the navigation pane.

User selects their respective screen and the home screen should give way to the selected form.

Also is it possible to have the home screen show the user's windows login name.

Hi,

To show the Login have a label (say lbl_Name). In the On Open event of the form have lbl_Name.caption = "Greetings " & VBA.Environ("USERNAME")

To make a full screen form you need to have Docmd.maximize in the on Open event.

Your form should also have popup = yes and menu bar = 1. Remove lines, border, control box etc.....see attachment for example of required properties. This works in pre access 2007, not sure if it does in 2007??
 

Attachments

  • fullscreen.JPG
    fullscreen.JPG
    74.8 KB · Views: 88
paste this code into a module to get the windows login name



Code:
Option Compare Database
Option Explicit

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
'----------------------------------------------------------------------------------------------------------------
' This code is used to retrieve the network user name by accessing the API apiGetUserName.
' Created by: Unknown (Found on Dev Ashish web site http://home.att.net/~dashish/api)
' This code has not been altered in anyway.
' Added to database: 19 Feb 2002
' Added by: Richard Rensel
'---------------------------------------------------------------------------------------------------------------

Function fOSUserName() As String
On Error GoTo fOSUserName_Err

    Dim lngLen As Long, lngX As Long
    Dim strUserName As String
    
    strUserName = String$(254, 0)
    lngLen = 255
    lngX = apiGetUserName(strUserName, lngLen)
        
    If lngX <> 0 Then
        fOSUserName = Left$(strUserName, lngLen - 1)
    Else
        fOSUserName = ""
    End If
    
  
fOSUserName_Exit:
  Exit Function
  
fOSUserName_Err:
  MsgBox Error$
  Resume fOSUserName_Exit
End Function
 
Just use this for windows login name:

Code:
username = VBA.Environ("USERNAME")
 

Users who are viewing this thread

Back
Top Bottom