|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Battling for days with FindFirst (Help)
I would be delighted if someone could help me resolve this problem.
I am trying to add a record to a table but; 1. Check that the input is not Null 2. If the input is not Null, check if the name does not exist already 3. Add a record if the name does not exist. 4. If the name exist already, store the person's address in a variable to display on a form The code below works fine except for point 4. It always display the address of the first record in the table. Please help!! Many Thanks Dim db As DAO.Database Dim rsMembers As DAO.Recordset Dim NewName As String Dim NewAddress As String Set db = CurrentDb() Set rsMembers = db.OpenRecordset("tblShareMembers", dbOpenDynaset) If TransfereeName <> "" Then NewName = TransfereeName Dim rst As DAO.Recordset Dim MemberName As String Set rst = db.OpenRecordset("tblShareMembers", dbOpenDynaset) MemberName = "Name = '" & TransfereeName & "'" rst.FindFirst MemberName If rst.NoMatch Then ' Call the function that adds the record. AddMembers rsMembers, NewName, NewAddress MsgBox "You must enter the Transferee's Name and address.", , "Fairview" rsMembers.Close Else TransfereeAddress = Address End If Set rst = Nothing Else MsgBox "You must enter the Transferee's Name and address.", , "Fairview" End If |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Battling for days with FindFirst (Help) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|