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

  • Thread starter Thread starter h3llz
  • Start date Start date
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?
 
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
 
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
 
Back
Top