Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 1st, 2005, 07:59 PM
aecarpin aecarpin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 4 aecarpin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 17 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Battling for days with FindFirst (Help)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT