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:

Similar posts...


set focus specific form

set focus specific form Icon
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 Syntax Error

DoCmd.OpenForm Syntax Error Icon
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"

DoCmd.OpenForm Expected

DoCmd.OpenForm Expected Icon
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

What actually happens at docmd.openform Icon

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

Argument not optional Icon
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

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

DoCmd.OpenForm method - go straight to EOF ( recordset ) ? Icon
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

Simple code im derping on :P

Simple code im derping on :P Icon
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.TransferSpreadsheet acImport xlsx format from MS Access 2003

DoCmd.TransferSpreadsheet acImport xlsx format from MS Access 2003 Icon
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?

i need a docmd.openform code

i need a docmd.openform code Icon
I need a fully docmd.openform command with where statement
Form name : repairs
Query name : qCustomers
Field name : customer name (i want to open form with all the records refer to a single customer

DoCmd.CopyObject Not working

DoCmd.CopyObject Not working Icon
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