Access Form - Double-click question

D

Decembersonata

I have a database I'm finishing up and one of the last features I need to add
is a simple double-click event that populates the control source with a Yes
when double-clicked. For whatever reason, I can't seem to get this function
to work. Any suggestions?
 
S

Steve Schapel

Decembersonata,

Can you say... the double-click event of what?

What is the code or macro that you have tried so far?

Do you really mean the control source, i.e the Control Source property? Or
do you mean you want to insert this value into the control?

What sort of control are you talking about? And what is its data type - a
Yes/No field or a Text field?
 
C

CompGeek78

I have a database I'm finishing up and one of the last features I need toadd
is a simple double-click event that populates the control source with a Yes
when double-clicked.  For whatever reason, I can't seem to get this function
to work.  Any suggestions?

I'm not sure why you want the Control Source of some object to be Yes,
but if that's what you really want:

On the double click even of whatever it is that you are double
clicking, add code like this

me.controlname.ControlSource = "Yes"

where controlname is whatever thing it is you want to set the
ControlSource property of.

Keven Denen
 
D

Decembersonata

Here is the code thus far:
Private Sub Text93_DblClick(Cancel As Integer)
Me.Completed = "Yes"
End Sub

Nothing happens on this event.

When I say control source I just meant the field that will be populated that
my form is based off of. It's currently a text field. I want the user to be
able to double click the blank field and have a Yes populate in the field.
This then drives a later query which only pulls records with the completed
field marked as Yes.
 
D

Damon Heron

Why not just have a checkbox with the controlsource = to your table field
(which, I'm assuming, is a yes/no field)?

Damon
 
D

Decembersonata

Yeah, you're right, I'll just do that.

Damon Heron said:
Why not just have a checkbox with the controlsource = to your table field
(which, I'm assuming, is a yes/no field)?

Damon
 
L

Larry Linson

It is a lot simpler to figure out why something isn't working if you tell us
what you did. I'm sure a lot of people could offer a lot of suggestions, but
we'd be wasting our time as they might not, in fact, have any applicability
to what you're doing.

What kind of control are you using for a bound Yes/No value? Both
CheckBoxes, Radio Buttons, and Toggle Buttons have standard single-click
action that automatically changes/reverses (aka, toggles) a Yes/No value.
Thus, it would be unusual, in my experience, to see a Double Click used as
you described, and it would be unusual to see a Yes/No value bound to a
different control.

Please be specific, precise, and concise.

Larry Linson
Microsoft Office Access MVP
 
D

Decembersonata

Larry,

I realized after posting that I was really trying to make this too
complicated. I've switched the field in question to a Yes/No field, and it
works just fine now. Thanks all for the input.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top