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...

 

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:
 

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
 

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?
 

Accessing DoCmd OpenForm values from within a form

Accessing DoCmd OpenForm values from within a form Icon
When one uses the DoCmd OpenForm method there are certain parameters that can be given, including a DataMode value.

Is there any way in which any of these parameters/values can be accessed from within a form as, for example, either a form or application property or parameter when the form is either being opened or loaded?
 

Problem with OpenForm command

Problem with OpenForm command Icon
I would like to use the OpenForm command to open Form2 to the same databaseID I updated in Form1

DoCmd.OpenForm "Form2", , , [ID] = Forms![Form1]![ID]

However, when I do this, Form2 opens to ID + 1.
 

VBA Return a Value from Docmd.OpenForm to a Report

VBA Return a Value from Docmd.OpenForm to a Report Icon
I have a report that when it opens it will propt DoCmd.OpenForm which will open a form that will filter the results of the report. The problem is that if you close the form withoutinitializing the filter it will return an error because the report fields will not be defined.

What I would like to do is on a Form_Close event return a variable to the Report_Open event which will cancel the creation of the report.
 

Login form remain open after success

Login form remain open after success Icon
I have a login form in my database. I used vb code for this form

Private Sub Command31_Enter()
If Me.valita = "abc123" Then
DoCmd.OpenForm "start"
Else
DoCmd.OpenForm "wrong_pass"
End If
End Sub

but after login success entered password the login form remain open. DoCmd.Close acForm, "login"
 

Help access 2010 to 2003 vba and sql problem!

Help access 2010 to 2003 vba and sql problem! Icon
And a sql statement in the criteria part of my query.

Everything was working fine in access 2007 and 2010, when I converted it in access 2007 to access 2003 format when I open my form it keeps asking for a parameter, which is point to the textbox that the query criteria is based on.

I am supposed to implement this on our computers at work tomorrow, but I've got to get it working in access 2003 format.

The 2007/2010 and the 2003 access files. A professional could probably look over it in 5-10 min and be able to tell me what is wrong.
 

report filter not working in Access 2010 SP1

report filter not working in Access 2010 SP1 Icon
Windows auto installed Office 2010 SP 1 and now my Access 2010 reports no longer work. It is a Access 2003 mdb file running in Access 2010. It was working fine till SP 1 was installed.

DoCmd.OpenReport strReportName, acViewPreview, , strSQL

the report opens fine, but no longer filters like it used to. (In my case I am filtering dates, using the # characters.)
 

TransferSpreadsheet method ERROR: Access engine could not find the object 'CurrentDeptList'

TransferSpreadsheet method ERROR: Access engine could not find the object 'CurrentDeptList' Icon
'I'm using the TransferSpreadsheet method to export a table called 'CurrentDeptList' from Access 2007 into Excel 2003. IT WAS WORKING FINE YESTERDAY!

for no apparent reason, every time I run it I get the following error: "Run-time error '3011' The Microsoft Office Access engine could not find the object 'CurrentDeptList'. Make sure the object exists . . ."

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "CurrentDeptList", ExcelDirPath & "\" & "CusNameDeptChng.xls"

Here's what I've tried:

1) I ran it from 5 different backup copies - Same result!

2) I've completely re-installed Access 2007 and MS Office 2003.
Not only won't this work, but now I can't get any DoCmd.Transfer methods working.

3) I added 5 more Microsoft References in. I also copied my database to another PC with Access 2007 and got the - Same result!

4) I opened a blank database and imported ALL the objects from my DB into it - Same result!