VBA code

jrsarrat

New Member
Joined
Jul 8, 2018
Messages
47
Hi there!

I have created a login screen for users, and installed a VBA code to notify them of a successful or unsuccessful login (with the click of a button). From a successful login, I would like Access to default to a specified form to add new records. What code would I use? Do I enter the command in the same VBA box I stored the other command?
 
Awesome! Thank you!
My new conundrum is this - My "Find Record" button on the form is not available now -- "The command or action 'Find' isn't available now."
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Yes, that code will open the Form in New Record only mode.
If you want to open the Form so that it shows/lists all current records, but opens up to the new Record option, then try this instead:
Code:
    DoCmd.OpenForm "FormName", acNormal, "", "", , acNormal
    DoCmd.GoToRecord , "", acNewRec
 
Upvote 0
Wow! This is great!
Question: Perhaps I want to change it back to "New Record only mode, but this time add a query button on the form that will give each user a report of *their own entries. I know it's possible to create that query button, but what code would I use to specify the query selection based on user login?

Thank you for your reply!!!
 
Upvote 0
Question: what source can I use to enhance my ability of implementing codes? I'm also unfamiliar with the purpose of each DataMode Argument.
To be honest, I usually just do Google Searches (like on "Access DoCmd.OpenForm"), and check out a bunch of the articles until I found one I like.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top