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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TEXT DISAPPEARS FROM COMBO BOXES QUERY

Status
Not open for further replies.

fsweb2002

Programmer
Apr 11, 2002
94
TR
Hi
I have a form with 4 combo boxes.
Everytime I select a different option, the form runs an SQL query according to the 4 "texts" on each combo box.

What happens is that the combo box texts disappear, what appears to be at random.
Although the QUERY is run successfully, I have 1-3 combo boxes BLANK!
The text appears to be there, but is transparent.
You can highlighted, etc etc just like if it was there, but can´t see it !
There are no routines which change the color of the text or anything, so I know that´s nt the problem.
Anyone knows what causes the problem ???
Thanks


 
Hi,
I am having the same problem. Did you ever find a solution for this? My form has three text boxes and a button to run a query. It seesm that if I enter text in the first box and then without hitting enter, I click th buton, the query runs successfully but the text no longer appears. As you said, it seems to be there, I can highlight it and all but it's invisible! I tried running a refresh on the form before running the query but it still gives the same thing. Only if you hit enter after entering the text does the text reappear after the query has been run. I also tried to use a sendkeys to force the enter but it doesn't seem to work. If you figured this out I would really appreciate some help!

Itchy
 
Hi there
I am glad to know that I am not the only miserable person having this problem!
Nope, I haven´t found a solution. I can´t believe no one in the forum has got this problem. It is such an important thing (to do searches, etc) but no one mentions it...

Anyway, there are ways around it (using a duplicate set of invisible fiels) which I think it will work.
Since it is only 3 combo boxes I use, it is not much trouble to duplicate them.
However I am currently working on the same program, but a more important thing, so I´ll leave this problem until later.
Once I do the work around, I´ll let you know....
Regards
 
Hi,
I too have found a work around. What I have done is in the On Mouse Down event of the button, I change the focus to another field on the form (a combo box) before the On Click event kicks in. This seems to, I guess, 'update' the text field and for whatever reason, the text no longer disappears after the query. If I happen to figure this one out, I'll let you know!

Itchy
 
Hi there

I´ve done what you´ve told me, but it doesn´t work.
I put the focus to another (invisible) combo box I added.
When I click the SEARCH button, I have

Private Sub cmdsearch_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmbtrick.SetFocus
End Sub

If the value of any of the combo boxes doesn´t exit on the list, obviously it finds no record.

So I then select other values on the combo boxes and they automatically dissappear...

So the problem still there, at least the way I did it...

Thanks
 
Hi,
Here's what I tried:

Private Sub Go_button_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)

Me.field1.SetFocus
DoEvents

End Sub

I don't know if the DoEvents is making the difference but its worth a try!

Itchy
 
Doesn´t work for me...

this is my work around and works fine...the only thing is that I had to add a record to match the criteria cmbPOL=VALENCIA cmbPOD=VALENCIA eitherwise it loops continuously...

After I press the SEARCH button,I run the following SQL

Private SEARCH_click

Me.RecordSource = sqlline 'sqlline is the SQL line

HOWMANY = Forms![Buying Rates Query].RecordsetClone.RecordCount ' checks to see how many records found

If HOWMANY = 0 And lbltrick.Caption <> &quot;YES&quot; Then
'lbltrick is an invisible field so it stops looping
lblnorecordfound.Visible = True
unblank
Else

End If

end sub


Private Sub unblank()
cmbPOL = &quot;VALENCIA&quot;
cmbPOD = &quot;VALENCIA&quot;
Me.cmbshippingline.Value = &quot;ALL&quot;
lbltrick.Caption = &quot;YES&quot;
RUNSQL
lbltrick.Caption = &quot;NO&quot;
lblnorecordfound.Visible = True
cmbPOD.SetFocus
cmbPOD = &quot;VALENCIA&quot;
End Sub

 
Hi There,
I was just wondering if my solution is not working for you because you would be setting the focus to a control that is not visible. You could always try making the control visible just to see if it works. If it does, then just set the focus to one of your visible controls. Otherwise, I really don't know! Sorry I couldn't be of any help!

Itchy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top