473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

separate firstname and lastname into separate fields

hi ive got a newbie question!

its in the pic shown with my prob! pls tell me asap! pls pls!


http://i242.photobucket.com/albums/f...question-1.jpg

pls show me how to do it! pls right the whole code!
im really a newbie n i really have no idea pls! thnx in advance!
Dec 4 '07 #1
5 5780
puppydogbuddy
1,923 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnOK_Click()
  2.  
  3. Dim strFirstName As String
  4. Dim strLastName As String
  5.  
  6. 'parse full name string entered in textbox (txtFullName)
  7.     strFirstName = Left(txtFullName, InStr(1, txtFullName, " ") - 1)
  8.     strLastName = Mid(txtFullName, InStr(1, txtFullName, " ") + 1)
  9.  
  10. 'assign parsed strings to the appropriate textboxes
  11.  
  12. Me!txtFirstName =  strFirstName
  13. Me!txtLastName =  strLastName
  14.  
  15. End Sub
Dec 4 '07 #2
hey thnk you so much! i really apreciate it! thnx thnx thnx!
Dec 4 '07 #3
how can i make it work the other way! like when i type in the firstname and lastname it will apear in the box above or if i type in the box above the firstname and lastname will appear in the firstname and lastname box! i want to make it work both! pls help ehheh! hope u undrstand my question heheh! thnx for the help!
Dec 7 '07 #4
missinglinq
3,532 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnOK_Click()
  2.  
  3.   Dim strFirstName As String
  4.   Dim strLastName As String
  5.  
  6.  If IsNull(Me!txtFullName) and IsNull(Me!txtFirstName) and IsNull(Me!txtLastName) Then
  7.    Msgbox "You Must Enter Either Full Nmes or First and Last Name!"
  8.    Exit Sub
  9.  End If
  10.  
  11.  If Not IsNull(Me!txtFullName) Then
  12.  
  13.  'parse full name string entered in textbox (txtFullName)
  14.       strFirstName = Left(txtFullName, InStr(1, txtFullName, " ") - 1)
  15.       strLastName = Mid(txtFullName, InStr(1, txtFullName, " ") + 1)
  16.  
  17.   'assign parsed strings to the appropriate textboxes
  18.  
  19.   Me!txtFirstName =  strFirstName
  20.   Me!txtLastName =  strLastName
  21.  
  22.  Else
  23.  
  24.  Me!txtFullName =   Me!txtFirstName & " " & Me!txtLastName 
  25.  
  26.  End If
  27.  End Sub
Welcome to TheScripts!

Linq ;0)>
Dec 7 '07 #5
weeeeee gee thnx so much! i cant thnk you enough! thnx thnx! ur a genious! wish i had ur brains eheh!
Dec 7 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Apekshit | last post by:
Hi.. I have a VB form..in which there are ten textboxes..These textboxes hold data from an Access database everytime depending on record number. Out of these 10, three are static..means these...
6
by: Mark 123 | last post by:
Hi I am getting an Object Expected error when using the following script. Can anyone see any syntax error? <script> aTemp=location.href.split("?");
3
by: Young Seeker | last post by:
Hi, I created two forms using forms wizard. One was for a master table that has just an ID and Description column. Another was for a transaction table that has foreign keys from the master table...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
5
by: Theresa Hancock via AccessMonster.com | last post by:
I have an Excel table I need to import into Access. The name is entered into one field "Name". I'd like to have two fields in Access, FirstName and LastName. How do I do this. -- Message posted...
3
by: fstenoughsnoopy | last post by:
Ok the complete story. I have a Contact Table, Query and Form, that are used to input and store the contact info for customers. They have FirstName, LastName and Address as the primary key...
2
by: drurjen | last post by:
Good morning. I am importing an XLS file into one of my tables. The fields are: Date Id Time IO 12/22/2006 2 12:48:45 PM 9 12/22/2006 16 5:40:55 AM 1 12/22/2006 16 12:03:59 PM 2 ...
2
by: Nathan Sokalski | last post by:
I have a Repeater that uses a DataSource that has multiple fields. When the values of these fields is displayed in the Repeater, there are fields that are used in combination with other fields as...
5
by: CJBee | last post by:
I have the following html code and php code. I would like clients to select which fields in the mysql database they would like to have appear in the resultant table by checking the text box next to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.