Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkbox must be unchecked after form closes

Status
Not open for further replies.

Superguppie

Technical User
Jan 19, 2005
107
0
0
NL
hi all,

when a user closes a form, then another form opens with information that this has happend by User actions, when that form closes, a Checkbox in the form must be unchecked, in VBA i had this:

Me.afgemeld = False

But then the following error occurse:

Cannot give amount to this object.

can someone explane why this is and how to solve this?
thanks

Greetz

Superguppie
 
How are ya Superguppie . . .

Indications are your running the code in the forms [blue]On Close[/blue] event. Try moving the code to the [blue]On UnLoad[/blue] event.

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
when i set it to Unload, it will give me a warning, that another user is trying to insert data, do you want to ignore or cancel, (cancel = the other users data will be entered, Ignore = my data will be insert in table, but no other user is in the database, (also db is not opened twice) when i set Setfocus in VBA, access tells me: cannot set focus to me.afgemeld

 
can you explane what Bound and unbound is???? because i dont know:S

Thanks

Superguppie
 
Bound :

Does the check box have a data source in the properties feild of the form ? In other words, are you saving the check boxes value to a table or query ?

If so, the underlying record is "dirty" (not saved) and has to be saved first.

If the check box has a data source, try deleting it. The check boxes property should then say "unbound" as it's data source.


Tyrone Lumley
SoCalAccessPro
 
ah ok, i get it, then yes the checkbox is bound to a query
and i also get what is happening

on the mainscreen, there is a form (that gets data from query 1) and on that form i check the checkbox, then a form opens with the question blah. then when i press afmelden, the form ask me are you sure? then i say no, and the form closes, and another form opens with information that the record is still active and not canceled (the checkbox on mainscreen will deactivate the record and delete it from query) but this form also get its data from Query 1, so the mainscreen is trying to save something and the form. am i right or...........

if so, what to do,

Greetz Superguppie
 
I have the same or similat issue with a unbound check box stays on after you move to the next record. I always want the check box to not toggle but be off when a record opens.
my question is "onclose" and "onunload"

I do not have either of those events ??? access 2003
what gives

thanks

David
 
etcrier: Too easy Mate, give this a go

OnCurrent Event, (which fires when moving between records)

Code:
me!chkbox=false

Have a great weekend:)

JB
 
PS. Your question is a bit different to the OP (Original Post), so you may consider reposting your question as a new thread. Some people in future may read half way down and think "Aw, crap, this isn't my problem!" and move away. Up to your, just an idea i'm putting out there...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top