combo boxes

M

Melissa

Hi there

I have designed a Windscreen repair database. On the switchboard, I have
two combo boxes. One is to search by Company, the other is to search by
Client.

These combo boxes work perfectly. However, when i first created them, i had
them on the "On enter" event, that when i type in the client name and press
enter it opens the Company form showing that record, which was fine. Now I
would like to put this event on the "On Dbl Click". But when i type the
company name, i have to first click somewhere else on the form before the
doubleclicking works?
(this is for the "company" combo box)...

then for the "Clients" combo box, the first few times i double click, it
opens the "Clients" form blank. it only works after a few times. it says
that there is a problem with my code?

Please tell me what the problem could be, i dont see how there can be a
problem if after a few times it does work?...

thank you kindly

Melissa
 
A

Al Campagna

Mekissa,
If I understand correctly...
Try using the After Update event of Company.
Upon selecting a Company, you could then open the Company form for that
selection.

On the Client combo, use it's After Update event to Refresh the form, and
then call the Client form.
That should work...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
A

Al Campagna

Melissa,
2 points about my previous post...
1. Sorry about misspelling your name.

2. To this...for that
selection.
(Add this)
Also, the AfterUpdate event can be used to Requery the Client combo.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
M

Melissa

Al

Thank you very much for your assistance. I really appreciate it.

I have now tried the AfterUpdate, which works, when you press enter it opens
the company form for that specific company, also , this is working for the
Client combo as well. However, my client would like to "DblClick" on the
company and client for the respective forms to open. is this possible?

As I said earlier, it does work, but after typing the company's name you are
searching for, you first need to for example, click in the Clients Combo and
then double click in the Company combo for it to work? What could be causing
this? it is the same with the Clients Combo box? it only works if you first
move the cursor into the Company Combo, and then when you put the cursor
back in the clients combo and dblClick, it works?

thank you kindly

Melissa
 
A

Al Campagna

Melissa,
Somethings amiss here. I can not duplicate your problem (A97 and
A2003).
I've used the Dblclick event of a combo for years... to open the
supporting detail form for the specific combo entry. Granted, I haven't
usually DblClicked those entries right after selection, but that shouldn't
be an issue.

Here's how I tested your problem...
I placed an unbound text control on the form called Test.
I set up the following event code for Company.
OnEnter... Test = "OnEnter"
AfterUpdate ... Test = "AfterUpdate"
DblClick... Test = "DblClick"
No matter how I selected a company (type it in manually or select from
list), whenever I DblClick the Company, I get a "DblClick" in Test.

Would you try this, and let me know if you get different results?

Also, tell me exactly how you usually enter a company.
Example... I type "Mic", the combo, through AutoExpand = Yes, the combo
shows me "Microsoft" (which I want), so I just hit the Enter key.

Otherwise, it may be necessary to send me your zipped application to my
website Contact Me (below)
In your email subject include the word "NewsGroup", tell me waht Access
version you are using, and what form and controls are involved.
Confidentiality insured, and of course... no charge.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
M

Melissa

Mr Campagna,

I have emailed you my zipped application to your ccc.....address.

Thank you kindly for your assistance.

Melissa
 
A

Al Campagna

Melissa,
Unfortunately my spam program caught your post. I emailed you back
using the address you sent "from", but have received no reply.
(e-mail address removed)
So I'm posting here too.

Please resend the zipped mdb. I got your email message Body, so I know
all the info about the file. I just couldn't get back the zipped
attachment.
I have your address listed as a Friend... so it should go through next
time.
Sometimes spam filters are too damn smart for their own good.

Also, I may have to solve the problem in 2003. I don't have 2002
installed.
Mea Culpa...
--
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
A

Al Campagna

Melissa,
Just posting here as a backup to the email I sent you today...
------------
I just tested your DB, and it works perfectly.
I think I know what the problem is.

In your email you wrote... (and that's why I told you to describe the
process "exactly"... which you did)
I need to type in the first few letters of the Company name, eg:
"Jo"..which will then autoexpand to bring up the company: "Jonen Freight",
then double Click, you will see that it then opens the "Company" form - but
its blank.

When you type "Jo" into the combo, the AutoExpand feature finds (and
displays) "Jonen Freight"... *BUT*... the value has not been written to the
bound field (Updated) yet.
A double click at this time will bring up a blank company form.

You must hit Enter, or preferably Tab to actually update the Company
value that AutoExpoand located. If you now double click Company, it opens
to the correct Company record.

I wrote in an earlier post...
Here's how I tested your problem...
I placed an unbound text control on the form called Test.
I set up the following event code for Company.
OnEnter... Test = "OnEnter"
AfterUpdate ... Test = "AfterUpdate"
DblClick... Test = "DblClick"
Would you try this, and let me know if you get different results?

Had you tried this, you would have seen that the AfterUpdate event never
fires using your entry method. Even though we have no code in AfterUpdate,
it must occur so that there is a value to pass to your stLinkCriteria when
opening the Company form.

I'll keep your DB for just a few days, and then delete it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
M

Melissa

Mr Campagna

I have replied on your email......thank you very much for your assistance

Melissa
 

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