Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2005
    Posts
    113

    Unanswered: Naming the program by VBA

    Hello,
    I have three access databases of the same kind but with different names. I would like to name the program by using VBA when the user starts the program. How would I go about doing that?

    Thanks!

  2. #2
    Join Date
    Apr 2006
    Posts
    157
    I'm not sure I understand what you mean by naming the program, you can just rename the form captions and the filenames manually if that is what you wish.

    but perhaps your question needs more detail as to what you truly wish to achieve
    Only quitters quit!

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    equally Im not clear what you want to do
    if the applications are the same, just the data is differnet consider splitting the DB into a single font end & 3 separate backends and connect thot he relevant back end as required (eith via ODBC/DAO or through the link object)

    OR create an entry point access form, which appears as each of the access projects, as part of the on load / splash screen, and if the current application isnt the required one switch to what ever the user wants to.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Nov 2005
    Posts
    113
    I would like to rename the program under Tools Start menu.

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by Julita
    I would like to rename the program under Tools Start menu.
    ..sorry dont understand
    do you mean you want to rename the access file from oldfilenam.mdb to newfilename.mdb
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Or do you want to change the Application NAme i.e. the name that appears in the title bar of the app?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Join Date
    Nov 2005
    Posts
    113
    Yes. Like you sed Missinginq " I want to change the Application NAme i.e. the name that appears in the title bar of the access app window next the key icon (access icon).

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    As I understand it this can only be done thru Tools->Startup-> Application Title. Access locks it from change except thru this method by making this application property Read Only.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  9. #9
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    Check out the AppTitle property in help. According to the help you can set it.

  10. #10
    Join Date
    Nov 2005
    Posts
    113
    Thanks a lot. It was what I needed.

    Code:
    Sub cmdAddProp_Click()
    	Dim intX As Integer
    
    	intX = AddAppProperty("AppTitle", dbText, "Mitt eget program ")
    	intX = AddAppProperty("AppIcon", dbText, "C:\Windows\Bilar.bmp")
    	RefreshTitleBar
    End Sub
    
    Function AddAppProperty(strName As String, varType As Variant, varValue As Variant) As Integer
    	Dim dbs As Database, prp As Property
    	Const conPropNotFoundError = 3270
    
    	Set dbs = CurrentDb
    	On Error GoTo AddProp_Err
    	dbs.Properties(strName) = varValue
    
    AddAppProperty = True
    
    AddProp_Bye:
    	Exit Function
    
    AddProp_Err:
    	If Err = conPropNotFoundError Then
    		Set prp = dbs.CreateProperty(strName, varType, varValue)
    		dbs.Properties.Append prp
    		Resume
    	Else
    		AddAppProperty = False
    		Resume AddProp_Bye
    	End If
    End Function

  11. #11
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Renaming

    Here's a vbs script which may help. It renames with the user's loginID and then opens that mde file. You may be able to tweak it to something you're doing.
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •