DoubleClick to Open Data Entry Form

JordanTaylor

New member
Local time
Yesterday, 19:47
Joined
Feb 12, 2024
Messages
4
Hello all. It's been a hot minute (decade and a half) since I last had to make an Access Database, so there's a few things I'm forgetting. Also at a new place of employment and don't have access to my older DBs to take any queues from them. So here's my issue:

I'm making an activity log that will track status of certain projects by the personnel involved, the Parts involved, open status, etc. I have a Combo Box being used for the Employee name, and I want to limit it to to a list based on another Table with the Employee information in it. If the Employee name isn't in that table yet, I want to double-click the field to open the Data Entry form, and enter the new name, and when I close that form, it will refresh and allow me to select that name from the ComboBox. Problem is, I keep getting Syntax errors on the Event Procedure Page.

This is what I have for Code currently:

Private Sub Combo26_DblClick(Cancel As Integer)

DoCmd.OpenForm(FRM_Employee_Info,[acNormal],,,[acFormAdd],[acWindowNormal],)


I've been trying to follow the automated tooltip that comes up as I type in the code, but no matter if I use Quotes/Parenthesis/brackets or not, I keep getting Syntax errors. I remember when working with my older DBs, I could copy out code from another section and modify it accordingly with the correct form names and it worked flawlessly, but like I said, I don't have access to my older DBs to be able to borrow that code. I do remember there was some other options like some kind of Error options, but at the moment, I haven't the foggiest what those would be.

Any assistance would be greatly appreciated! Thank you!
 
The name of the form gets passed as a string. It need quotes "frm_Employee". The arguments do not use []
Check with MS for examples.
 
New Line looks like this and still gives me Syntax Error:

DoCmd.OpenForm"FRM_Employee_Info",acNormal,,,acFormAdd,acWindowNormal,
 
Make sure to copy and paste. If it really looks like that you have a comma at the end.
 
Also acNormal and acWindowNormal are defaults and you do not need to pass those.
 
Ok, so I didn't need to follow all the comma seperated arguements... This was all I needed:

DoCmd.OpenForm "FRM_Employee_Info"


Thanks MS for making things more difficult than necessary!

And Thank you for the assistance!
 
It might be easier for you if you just used the built in method - the NotInList event.
 

Users who are viewing this thread

Back
Top Bottom