Topics Search

Access 2003: DoCmd.OpenForm is not working for me

Access 2003: DoCmd.OpenForm is not working for me
Views: 5
It opens up a dialog box.

DoCmd.OpenForm (frmActionUser,acNormal,,,acFormReadOnly,acDialog,)

I know I'm missing something because it generates the following error: "Compile Error: Expected Expression"

For reference, When the button is clicked, a box appears where the user has to input a uniqe Tracking ID. If the Tracking ID does not match any in the background table, it returns an error message.

If it is correct, a dialog box opens for the Tracking ID with pertinent data. The Tracking ID's are always going to be numerical. Here's thefull code (hopefully...
Sponsored Links:

More topics


DoCmd.OpenForm Syntax Error

I think I have been staring at this too long. Can somebody tell me why it's not working?
DoCmd.OpenForm "frmListProcDefaults", , , "ProcName= & Me.ProcName"

set focus specific form

I have a problem with regards with the setfocus of certain form. I have a command button that will open several forms and once open I want to setfocus it in "Purchase Requisition" form. please see code below

Private Sub Login_Click()
Dim Password As Variant
Password = DLookup("Password", "Users", "UserID = '" & Me.txtUserID & "' ")

If Nz(Password, "") = Me.txtpassword Then

DoCmd.OpenForm "Purchase Requisition"
DoCmd.OpenForm "Purchase Order"
DoCmd.OpenForm "Supplier Information"
DoCmd.OpenForm "Archive"
DoCmd.OpenForm "Others"

MsgBox "Incorrect user ID or password"
End If

End Sub

DoCmd.OpenForm Expected

I'm attempting to pull a row of data in a table by opening a separate form using the DoCmd.OpenForm command. I have raw data that is copied into a text box and the code pulls out the time, tech and customer.

That all works fine but the OpenForm is failing me! I CAN run the code as follows:

What actually happens at docmd.openform


Im relatively new to Access but have some background in VBA programming.

Currently im dealing with a relatively large Database (Access File size currently at 1GB) wich of course makes computations very slow.

Im now trying to speed things up a bit and was wondering what actually happens at the Docmd.openform command. I dont mean "The form is opened" but im wondering what happens in the background.
The problem is that some of my forms take extremely long to execute this single line, so I think there is something else happening besides the simple "form opening" task.

So if anybody knows how to deal with speed issues on docmd.openform or can explain what actually is checked/computed on this command, please answer!

Thanks in advance for all responses and excuse my english, im not a native speaker.

Argument not optional

I am writing some code for a database button but the error message argument not optional appears, saying that my OpenForm is incorrect.

Private Sub Command47_Click()
DoCmd.OpenForm.[tbljobs main]
DoCmd.GoToRecord , , acNewRec
DoCmd.ApplyFilter "jobs form search

Simple code im derping on :P

Private Sub Command24_Click()
If IsNull(Me.Text1) Then
MsgBox "You have not filled all boxes." & vbCrLf & _
"Do you want to continue?", vbYesNo, "Edit Visit Report"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "HomePage"
End If
Dim Msg As VbMsgBoxResult
If Msg = vbYes Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "HomePage"
End If
End Sub

Pretty self explanatory its not working when I press yes, when it should save and open "HomePage"

DoCmd.OpenForm method - go straight to EOF ( recordset ) ?

Can I use the OpenForm method, to open my form based on a query, and go IMMEDIATELY to EOF I.e. Here's my current statement, with just the query name to qualify it.

DoCmd.OpenForm "frmClients", , qry1

DoCmd.CopyObject Not working

I am trying to copy a table (structure and data) from my application to another database using the DoCmd.CopyObject method, but it is not working. Here is my code:

DoCmd.CopyObject "C:\iHaunt\Resources\Update.accdb", "tblParameters", acTable, "tblParameters"
DoCmd.OpenForm "frmLogin1", acNormal
DoCmd.Close acForm, Me.Name

I do not get an error when this code runs and it opens the form "frmLogin1" and closes the current form just fine. But when I go to the other database, the table is not there. Does the other database need to be open?

I've also tried this with DoCmd.TransferDatabase, and that does not work either

DoCmd.TransferSpreadsheet acImport xlsx format from MS Access 2003

In my machine I have Access 2003 and Excel 2010. Intially I have below code to import the 2003 spreadsheet into a the table in MS Access 2003.

DoCmd.TransferSpreadsheet acImport, 8, TblNm, FileN, True, "A1:S65536"

DoCmd.TransferSpreadsheet acImport, 10, TblNm, FileN, True, "A1:S65536"

It does not work I have the Microsoft Excel 14.0 object library selected in the references. I know using of '10' is not working because I am still using MS Access 2003.

Is there any way I can import the 2010 format excel spreadsheet to Access 2003?

OpenArgs not working

I have a subform (SubFrm_Warnings) which I need to appear according to which company record is open on the form. I have used OpenArgs on the DoCmd.OpenForm to set the companyref / ID number - this is working fine. I have now realised that although the correct company ID is now being set, the actually text box which contains any warnings is not linking to that company ID?

I know I must have to link this somehow. The forms involved are Frm_Search (where the DoCmd.OpenForm is); Frm_Company (which is the main form which includes all the company info) and SubFrm_Warnings (which is to appear on open of the Company form should there be any warnings for that particular company.

I have attached the database and posted the relevant code below...