Hello i have two fields, one text and the other combo

H

h3llz

Hello i have two fields, one text and the other combo. When i focus on one,
how can i make the other one blank?
 
T

Tom van Stiphout

On Wed, 3 Dec 2008 15:41:00 -0800, h3llz

Each control has a GotFocus event. In this event write one line of
code:
Me.TheTextbox.Value = ""
or
Me.TheCombobox.Value = ""
(of course substitute the control names for your names)

-Tom.
Microsoft Access MVP
 
H

h3llz

Using that will make another problem when the button is submited this is a
part of code which is executed to check which field is being used, because i
need to use SetFocus it will colide with the GotFocus events :<?
txtSuppliedProductID.SetFocus
If Len(txtSuppliedProductID.Value & vbNullString) > 0 Then
WHERE = " AND productID=" & txtSuppliedProductID.Text
Else
cmoSuppliedProductName.SetFocus
If Len(cmoSuppliedProductName.Value & vbNullString) > 0 Then
WHERE = " AND product='" & cmoSuppliedProductName.Text & "'"
End If
End If
 

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