Set Fields on Form from Table Data

Playbus

Registered User.
Local time
Today, 07:27
Joined
Sep 17, 2004
Messages
23
SetValue Question - Please Help!

I have a command button that I want to automatically enter the date into a date field on the same form.

Setvalue
item: [Forms]![FRM_View_Orders]![OrderDate]
expression: Date()

This works in Access 2000 -- but in Access 2003 I get this error message:

"Object or class does not support the set of events"

Please can anyone help me with what I am doing wrong in 2003.

Thanks!
 
Last edited:
Put this in the OnClick event of your button, assuming that OrderDate is the name of the control on your form.
Code:
Me.OrderDate = Date
 
Thanks for the reply!

I did what you said, but unfortunately I still get the error

"Object or class does not support the set of events"

:confused:

Do you know what I might be doing wrong?
 
Last edited:
on the On Click Event for the button, create a line of code that says:

[Forms]![FRM_View_Orders]![OrderDate] = Date()
 
businessman said:
on the On Click Event for the button, create a line of code that says:

[Forms]![FRM_View_Orders]![OrderDate] = Date()

If your in the form FRM_View_Orders and the control OrderDate in on the form, why do you need to use [Forms]![FRM_View_Orders]![OrderDate] = Date() , that is what Me. is for.

Have a look at my sample and you see that "Me" works fine.
 
i've gotten that error that Playbus got before and it solved it by including the whole phrase [Forms]![FRM_View_Orders]![OrderDate] = Date
 
businessman said:
i've gotten that error that Playbus got before and it solved it by including the whole phrase [Forms]![FRM_View_Orders]![OrderDate] = Date

Did you try my sample and if so , did it work for you?
 
Thankyou, ansentry, for taking the time to help me. :)

I downloaded your example, and it works. :D

However, it is exactly the same as my database. Apart from the names of fields, your example is exactly the same as what I have.

Except yours works, and mine does not.

:cry:

Can you think of any reason why?
 
Playbus,

I thnk that posting a copy of your db would be a good idea, I think it will be something to do with your references.

If you know how to, check the references in both mine and yours.
 
Thanks ansentry, I think I have found the problem. It's my PC!

I just recently started a new job and working on this database is part of the job.

When I tried your example, I did it last night from home ... where it worked.

I tried it at work today and I get the same error!

Therefore, my install of access at work is broken!!

I am now going to re-install my work PC!

Thanks again for your time, ansentry, I'm sorry to waste it.
 

Users who are viewing this thread

Back
Top Bottom