Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Hello i have two fields, one text and the other combo

Geek News

Hello i have two fields, one text and the other combo
h3llz 12/3/2008 11:41:00 PM
Hello i have two fields, one text and the other combo. When i focus on one,
how can i make the other one blank?
Re: Hello i have two fields, one text and the other combo
Tom van Stiphout <tom7744.no.spam[ at ]cox.net> 12/4/2008 4:15:23 AM
On Wed, 3 Dec 2008 15:41:00 -0800, h3llz
<h3llz[ at ]discussions.microsoft.com> wrote:

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


[Quoted Text]
>Hello i have two fields, one text and the other combo. When i focus on one,
>how can i make the other one blank?
Re: Hello i have two fields, one text and the other combo
h3llz 12/4/2008 9:14:02 AM
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



"Tom van Stiphout" wrote:

[Quoted Text]
> On Wed, 3 Dec 2008 15:41:00 -0800, h3llz
> <h3llz[ at ]discussions.microsoft.com> wrote:
>
> 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
>
>
> >Hello i have two fields, one text and the other combo. When i focus on one,
> >how can i make the other one blank?
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net