Re: Help w/ writing a If Statement
From: PC Datasheet (spam_at_nospam.spam)
Date: 02/18/04
- Next message: Desert Bear: "querying a query"
- Previous message: Kathy Ratermann: "Moving to a subform within the main form"
- In reply to: David Ehrenreich: "Help w/ writing a If Statement"
- Next in thread: David Ehrenreich: "Re: Help w/ writing a If Statement"
- Reply: David Ehrenreich: "Re: Help w/ writing a If Statement"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Feb 2004 19:46:12 GMT
Create a query based on CardInfoTbl and include these fields in this order:
SSN
FName
LName
On your form add a combobox with the rowsource the above query. Make the bound
column 1, column count 3 and column widths 1.5;0;0. You can now select the SSN
on your form!
Put this code in the AfterUpdate event of the combobox:
Me!FName = Me!NameOfCombobox.Column(1)
Me!LName = Me!NameOfCombobox.Column(2)
This code will automatically fill your first and last name fields on your form
when you select a SSN.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
resource@pcdatasheet.com
www.pcdatasheet.com
"David Ehrenreich" <anonymous@discussions.microsoft.com> wrote in message
news:12ccf01c3f654$b5b15790$a501280a@phx.gbl...
> Here is what I'm trying to do. In my form I have feilds
> for Ssn# FName, Lname. Since the social and Fname and
> last name are always connected. I would like it so that
> when I type in a ssn# the Fname and Last name are
> automatically entered into their feilds. Here is what I
> have tried and it failed :).
>
> Private Sub Ssn_LostFocus()
>
> If Not IsNull(DLookup "ssn","CardInfoTbl", _
> "ssn=")) Then
> FName = Me.FName
>
>
> End If
> End Sub
>
> Thank You
> David Ehrenreich
- Next message: Desert Bear: "querying a query"
- Previous message: Kathy Ratermann: "Moving to a subform within the main form"
- In reply to: David Ehrenreich: "Help w/ writing a If Statement"
- Next in thread: David Ehrenreich: "Re: Help w/ writing a If Statement"
- Reply: David Ehrenreich: "Re: Help w/ writing a If Statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|