Results 1 to 4 of 4
  1. #1
    bmartinez3 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Location
    austin texas
    Posts
    2

    Need to turn a VBA code into a Macro for Web Access 2010


    I have an web access dbase published, and need to secure the navigation form tabs based on the currentwebuser. The tabs which need to be secured on the form are as follows: cmdadminbutton; cmdTDbutton; cmdBASbutton. I also have following tables:

    Users (fields: UserName, UserLogin, UserSecurity)

    Security Level (field: Security Level) = ID 1 = Admin ; 2 = TD and 3 = BAS

    I have a Login text field name "txtUser"

    I want to do exactly this: https://www.youtube.com/watch?v=6GCTqYLTeH8

    but, I can't use the VBA code that was created in the demo above since web access does not take code nor the DLookup function.

    Here's what I came up with but I know its wrong, well because it doesn't work

    attached is what i have started for the macro (don't laugh ) for cmdadminbutton (which is one of the tabs in the form.)

    Please reply as soon as possible, thanks!!!!
    Attached Thumbnails Attached Thumbnails macro.png  

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I don't think can use Me. prefix in macros. I think that is a VBA only syntax. Just drop the Me.

    Cannot reference a table directly like that (Users). Must be a DLookup or the form must have the table in its RecordSource and then can just reference the field.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    bmartinez3 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Location
    austin texas
    Posts
    2
    June 7, thank you so much for your response. I will go ahead and move with your suggestions, hopefully that will take care of the trick. THANKS!

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I forgot to mention the form must be filtered to the single record. So I guess what you will have to do is take the user input and apply it as filter criteria to the form RecordSource. If the result is an empty dataset then the user input is not valid. This is truly brainstorming because I've never built web db.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to turn off prompt when running append query from code
    By GraeagleBill in forum Programming
    Replies: 5
    Last Post: 07-22-2013, 03:35 PM
  2. Macro - how to turn off warnings for action queries
    By msmithtlh in forum Programming
    Replies: 3
    Last Post: 03-22-2013, 11:00 AM
  3. Turn OFF Warnings in Access 2010
    By taimysho0 in forum Programming
    Replies: 3
    Last Post: 01-27-2012, 05:47 PM
  4. Access 2010 Macro Help
    By RayMilhon in forum Access
    Replies: 3
    Last Post: 09-30-2011, 12:03 PM
  5. Replies: 3
    Last Post: 12-06-2010, 04:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums