Access Runtime Error 2494
Contents |
Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help run time error 2494 Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor ms access runtime error Services Groups Website Testing Store Headlines Experts Exchange > Questions > VBA RunTime Error 2494 Want to Advertise Here? Solved VBA RunTime ms access runtime error 91 Error 2494 Posted on 2011-02-16 MS Access MS Applications MS Office 1 Verified Solution 9 Comments 1,989 Views Last Modified: 2012-05-11 I have a password prompt form with an "okay" button. When that Okay button ms access runtime error 5 is clicked, the action needs to check the password attempt vs the actual password, close the prompt form, open the next form and go to a control. This is my code. It is on the 'On click' event of the button............. Private Sub cmdAdd_Click() Dim stDocName As String stDocName = "USER_ADD" If Me.PasswordAttempt.Value = Me.PASSWORD Then DoCmd.Close
Ms Access Runtime Error 13 Type Mismatch
acForm, "SECURITY", acSaveNo DoCmd.OpenForm stDocName, acNormal, , , acFormAdd, acWindowNormal Forms!USER_ADD!NAME_SHORT.SetFocus Else DoCmd.CancelEvent Forms!SECURITY!Message = "Password Incorrect" End If End Sub I'm still learning vba and consider myself an amateur. Please tell me why this hates me so. 0 Question by:culpees Facebook Twitter LinkedIn Google LVL 75 Active today Best Solution byDatabaseMX (Joe Anderson - Access MVP) k Go to Solution 9 Comments LVL 75 Overall: Level 75 MS Access 75 MS Applications 15 MS Office 13 Message Active today Expert Comment by:DatabaseMX (Joe Anderson - Access MVP)2011-02-16 Not seeing the reason right off. Which Form is this code in? mx 0 Message Author Comment by:culpees2011-02-16 well, hey there. The code is on the first form which is the password prompt form called "SECURITY". The code is on the "Okay" button, 'on click' event, which would then open up the next form that requires restricted access. This next form is called "USER_ADD". (it's a simple data entry form to add user access to the application.) 0 LVL 75 Overall: Level 75 MS Access 75 MS Applications 15 MS Office 13 Message Active today Expert Comment by
is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post:
Ms Access Runtime Error 2105
click the register link above to proceed. To start viewing messages, select the ms access runtime error 3061 forum that you want to visit from the selection below. Results 1 to 9 of 9 Thread: Form ms access runtime error 2465 with cmd Button to open related form Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to https://www.experts-exchange.com/questions/26826914/VBA-RunTime-Error-2494.html Threaded Mode 09-10-09,02:20 #1 ratte View Profile View Forum Posts Registered User Join Date Sep 2009 Posts 16 Unanswered: Form with cmd Button to open related form Hello What I am trying to do is to have a from with information about a project. On that form I have 6 cmdButtons each to open a form that relates to the Sales Order number http://www.dbforums.com/showthread.php?1647571-Form-with-cmd-Button-to-open-related-form on the page with the buttons. My tables are Project Table =Sales Order Number (Key) =Project Number Service Engineer Table =SE ID (Key) =First Name =Last Name =Sales Order Number ID The relationship is a one (Project) to many (Service Engineer). Between Sales Order Number (Project Table Key Field) and Sales Order Number (Service Engineer Field). I can get the button to open the form but everything I type into that form makes a new record without the relationship to the Sales Order number. I appreciate any help. Attached Thumbnails Last edited by ratte; 09-10-09 at 02:30. Reply With Quote 09-10-09,08:21 #2 MikeTheBike View Profile View Forum Posts Registered User Join Date Apr 2004 Location Derbyshire, UK Posts 788 Provided Answers: 1 Originally Posted by ratte Hello What I am trying to do is to have a from with information about a project. On that form I have 6 cmdButtons each to open a form that relates to the Sales Order number on the page with the buttons. My tables are Project Table =Sales Order Number (Key) =Project Number Service Engineer Tab
understand this. I inherited a db with this code in the form. When http://www.pcreview.co.uk/threads/run-time-error-2494.3939559/ I test this in the Immediate Window it gives me this error: Run-Time error 2494 - The action or method requires a form Name argument. There https://bytes.com/topic/access/answers/960897-using-string-name-forms-____-text-value is such a form which is referenced here. Can someone please explain? thank you. Private Sub Label7_Click() On Error GoTo Err_Label7_Click Dim stDocName As String Dim time error stLinkCriteria As String stDocName = "NE_File_Type_Selection" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Label7_Click: Exit Sub Err_Label7_Click: MsgBox Err.Description Resume Exit_Label7_Click End Sub Private Sub Label8_Click() On Error GoTo Err_Label8_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "Myformname" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Label8_Click: Exit Sub Err_Label8_Click: MsgBox Err.Description Resume Exit_Label8_Click access runtime error End Sub TotallyConfused, Dec 15, 2009 #1 Advertisements Gina Whipp Guest TotallyConfused, You have forms named "NE_File_Type_Selection" and "Myformname" in the database? -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "TotallyConfused" <> wrote in message news:... >I am trying to understand this. I inherited a db with this code in the >form. > When I test this in the Immediate Window it gives me this error: > > Run-Time error 2494 - The action or method requires a form Name argument. > There is such a form which is referenced here. Can someone please > explain? > thank you. > > > Private Sub Label7_Click() > On Error GoTo Err_Label7_Click > > Dim stDocName As String > Dim stLinkCriteria As String > > stDocName = "NE_File_Type_Selection" > DoCmd.OpenForm stDocName, , , stLinkCriteria > > Exit_Label7_Click: > Exit Sub > > Err_Label7_Click: > M
Question Need help? Post your question and get tips & solutions from a community of 418,417 IT Pros & Developers. It's quick & easy. Using a string name in Forms!____!Text.Value P: 30 Dpot I'm working on a database that was created by someone else. They used a code to open a specific form based on the value of a combobox. The code is: Expand|Select|Wrap|Line Numbers DimstrFormAsString IfMe.ComboSelect.Value="A"Then strForm="AForm" ElseIfMe.ComboSelect.Value="B"Then strForm="BForm" ElseIfMe.ComboSelect.Value="C"Then strForm="CForm" ElseIfMe.ComboSelect.Value="D"Then strForm="DForm" EndIf DoCmd.OpenFormstrForm The actual code is quite long. The problem I'm running into is the form has some text boxes where I would like the values to carry over to the appropriate form that opens. Right now I have each form individually listed out like this: Expand|Select|Wrap|Line Numbers IfMe.ComboSelect.Value="A"Then Forms!AForm.Text1.Value=Me.Text1.Value Forms!AForm.Text2.Value=Me.Text2.Value Forms!AForm.Text3.Value=Me.Text3.Value EndIf And it will open the appropriate form with the text boxes filled in which is wonderful BUT since there are so many options I just wanted to simplify the code to read something like: Expand|Select|Wrap|Line Numbers DoCmd.OpenFormstrForm Forms!strForm.Text1.Value=Me.Text1.Value Forms!strFormText2.Value=Me.Text2.Value Forms!strForm.Text3.Value=Me.Text3.Value But I am getting "Run-time error '2494': The action or method requires a Form Name argument. Feb 9 '15 #1 Post Reply ✓ answered by jforbes Right, you'll either need to create a Form Variable and set it to the Form Instance and then set the values of the controls or use the Forms() or AllForms() collection to get a reference to the Instance of the Form and then set the values. ...I know that sentence was as painful to write as to read. There are a couple collections available to you. The Forms() and AllForms() collections have lists of Forms. The difference is that AllForms() contains all the Forms in your database regardless if they are opened or not. The Forms() collection contains only opened Forms. So you can refer to the Forms in the collections a few different ways. These examples aren't great, but they give an idea of the different ways to address Forms in the Forms() and AllForms() collections. So by using the Forms("formname") syntax, you can refer to the Form by