Auto update field on click (1 Viewer)

potatohead

Registered User.
Local time
Today, 00:35
Joined
Dec 23, 2005
Messages
10
Hi all

I've followed the instructions on this post:

http://www.access-programmers.co.uk/forums/showthread.php?t=85898&highlight=updating+field

But, unfortunately doesn't seem to be working for me.

I added the equivalant field to 'Hired' after I had previously made tables etc and started added code to forms etc.

When I type Me. a list of options available to type in appear, and 'Confirm' (my equivalant to Hired) does not appear, yet all of the other field names in the form associated to this table DO appear. Does anyone know how to get around this?

I've also set my field to be "Yes/No" - does this mean that the code is:

Me.Confirm = True

OR

Me.Confirm = -1
?

Many thanks
 

Rickster57

Registered User.
Local time
Yesterday, 16:35
Joined
Nov 7, 2005
Messages
431
field on form

Make sure the field on your form has it's Data Source name and "Other" name set to the same thing. Me. pulls the "Other" field name.
 

potatohead

Registered User.
Local time
Today, 00:35
Joined
Dec 23, 2005
Messages
10
Hi there - thanks for that!

I can now see the field after the Me. command.

However, the code still isn't working - I get an error saying:

"Run time error: 2467. The expression you entered refers to an object that is closed or doesn't exist"

The table the form is dependent on is selected in it's Data Source, and it is in this table that the Confim field is in, which I would like to update.

Any more suggestions?
 

potatohead

Registered User.
Local time
Today, 00:35
Joined
Dec 23, 2005
Messages
10
Hi there

I've played around and managed to get it to work.

What I've done instead is put the field "Confirm" into the form, and then hide it.

When the 'update' button is clicked, then this is also set to -1. Bit of an unprofessional approach - but works fine!

Thanks for the offer of help however!
 

FISHiEE

Fish obsessive
Local time
Today, 00:35
Joined
Nov 12, 2004
Messages
86
Does anyone know if it's possible to do this without having the field on the form and hidden or is that the best way of going about it?

Would the following approach work:

Dim db As Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset xxx
With rst
...
...
End With
rst.Close
db.Close

Or is there another better alternative?
 

Users who are viewing this thread

Top Bottom