Works on one comp, but not another?

bionicman

Registered User.
Local time
Today, 07:49
Joined
Jul 22, 2003
Messages
145
Hi There!!

I am working on a database to keep track of computer parts. I started working on it at work, and then wanted to work on it some more at home, but i am getting an error. I am running Access XP on both machines.

I am trying to run the following code from a button click on a form:

Code:
    Dim strWhere As String
    strDocName = "report1" 'Report Title
    strWhere = "[Computer]=" & Me![computer].Column(2)
    strWhere = "[RAM]=" & Me![RAM].Column(2)
    strWhere = "[HD]=" & Me![HD].Column(2)
    strWhere = "[FLOPPY]=" & Me![FLOPPY].Column(2)
    strWhere = "[CD]=" & Me![CD].Column(2)
    strWhere = "[MONITOR]=" & Me![MONITOR].Column(2)
    DoCmd.OpenReport strDocName, acPreview, , strWhere

Everything works fine on my computer at work, it displays the report just fine. When i try to run it at home, i get an error that says "Object doesn't support this property or method".

Does anyone have any idea's why this would be happening on one computer, but not another?

Thanks in advance.
 
The WhereCriteria should be a legal Where expression of a query without the word where. If your'e using text fields in your expression each value must be surrounded by a pair of '. I. e. "[Computer]='" & Me![computer].Column(2) & "' AND "
Code:
Dim strWhere As String
strDocName = "report1" 'Report Title
strWhere = "[Computer]=" & Me![computer].Column(2) & " AND "
strWhere = "[RAM]=" & Me![RAM].Column(2) & " AND "
strWhere = "[HD]=" & Me![HD].Column(2) & " AND "
strWhere = "[FLOPPY]=" & Me![FLOPPY].Column(2) & " AND "
strWhere = "[CD]=" & Me![CD].Column(2) & " AND "
strWhere = "[MONITOR]=" & Me![MONITOR].Column(2)
DoCmd.OpenReport strDocName, acPreview, , strWhere
 
Last edited:
I am still getting the error though... any other ideas?
 
The Answer Is.................

The reason is one of your objects isnt ticked in your reference list at home. Within the code view under debug i think it is you will find an objects list or reference list. There will be an item not ticked at home that you have ticked at work. So check which ones are ticked at work before you go home!

Regards,

DALIEN51
 
alright now this is wierd... i get to work today and the report does not run on my work computer now either. Nothing has been changed in the DB, it worked friday and not today.

Any ideas on how i can get this to work? i want to print a report based on what is selected in my form.

Thank you,
 

Users who are viewing this thread

Back
Top Bottom