Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / May 2008

Tip: Looking for answers? Try searching our database.

Empty Text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TimH - 06 May 2008 20:04 GMT
Thank you in advance!
I have a TxtName unbound and i would like to populate it with the
name(LastName, FirstName) that is bound to iether  ID(primaryKey) or
SSN(bound).
something like :
If len(SSN) =>0 Then

txtName = "Me.ID" & "LastName, " & "FirstName"

End if

I have tried to run this code in a number of event but it is not working.
Please Help.
Signature

timH

Douglas J. Steele - 06 May 2008 20:35 GMT
You need the references to the fields to be outside of the quotes:

If Len(Me.SSN & vbNullString) > 0 Then
 Me.txtName = Me.ID & ": " & Me.LastName & ", " & Me.FirstName
End If

The "Me." keyword is there to ensure that Access realizes that SSN, txtName,
ID, LastName and FirstName are all either controls on the form or fields in
the form's RecordSource.

The reason for adding vbNullString to Me.SSN in the Len function is to
ensure that it handles Null fields correctly.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Thank you in advance!
> I have a TxtName unbound and i would like to populate it with the
[quoted text clipped - 9 lines]
> I have tried to run this code in a number of event but it is not working.
> Please Help.
TimH - 06 May 2008 21:34 GMT
Again I thank you; It worked.
Signature

timH

> You need the references to the fields to be outside of the quotes:
>
[quoted text clipped - 22 lines]
> > I have tried to run this code in a number of event but it is not working.
> > Please Help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.