Changing field values (in code)

dreamspy

Registered User.
Local time
Yesterday, 23:41
Joined
Jul 13, 2006
Messages
18
I currently have this question in another thread, but it's probably less confusing just to post it again:

I have a checkbox on a form called "Item_Arrived", and when it is clicked, I want to put the current date into a field called "Item_arrived_date". Both of those are in a table called tblVOD_Items

the "Item_arrived_date" field is not on this form, and should not be visible (making it not visible is not an option, because it will be visible in Datasheet view). So by that I can't use the function:

me.Item_arrived_date = date

If i understand correctly, then I should use SQL for this, but I'm just not getting it to work. Anybody have some idea on how to do this?
 
I'm going to answer this question because I can do so without doing any research. Please in the future do not post the same question in multiple forums. It simply wastes the time of the people you want to help you. As in - I am wasting my time answering this question if it has already been answered by someone else.

Include the field in the RecordSource query. It doesn't need to be bound to a control. Then the code in the click event is just as you suspected:

me.Item_arrived_date = date
 
Thanks for your answer

The reason for why I put up a new thread was because the old one was getting rather confusing. But I'll keep this in mind in the future. ( I usualy don't do this)
 

Users who are viewing this thread

Back
Top Bottom