|
-
Apr 18th, 2001, 12:13 PM
#1
Thread Starter
Addicted Member
Hi,
I am making a multi-user address book. In the code below, I have no problem adding a new user to the database.
You see, I want the users of my program to select their username from a combo box, and type in their password, and then click a button to enter. Then have them be able to add the info (new records) they want (email, phone, etc.).
I have two tables (Users, and Info) with the field (UserId) in both tables, and a relationship between the two.
My question is...how do I add the the new records (email, phone, etc.) to that specific user? Also, how would I edit, and delete their specific record? I'm using VB5.
Thanks a lot,
Ron
'##################################
Dim db As Database
Dim rsNewContact As Recordset
Set db = OpenDatabase(App.Path + "\" + "mydatabase.mdb")
Set rsNewContacts = db.OpenRecordset("Users")
rsNewContacts.MoveLast
With rsNewContacts
.AddNew
!UserID = Trim(txtNewUserID.Text)
!Password = Trim(txtNewPassword.Text)
.Update
End With
db.Close
MsgBox "New Contact -- " + txtNewUserID.Text + " -- Was Added Succesfully", vbOKOnly
Form1.cmbUsers.AddItem txtNewUserID.Text
Close
Unload Me
'##################################
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|