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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 25th, 2002, 05:25 PM
mab mab is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 39 mab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Access 2000

Hi,

Can anyone point me in the right direction? I have the following code:
Set rs = db.OpenRecordset("select * from Batches where Batches.Table = " & "'olpl'")
With rs
.Edit
!Post = True
.Update
End With

I keep getting a message that there is no record to update. There should be a record. I stepped through the code and can't understand where the problem is. Appreciate any help.

Reply With Quote
  #2  
Old April 25th, 2002, 06:11 PM
CopeLand CopeLand is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Toronto
Posts: 40 CopeLand User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Hi,
Your querie's just a little wrong. Here's how it should look:

select * from olpl

You actually specify the table name just after the from keyword, so its like

select [fields] from [tablename] where [clause]
__________________
i am cope. i drink coke. i am in hope.i am cope. i drink coke. i am in hope.i am cope. i drink coke. i am in hope.

Reply With Quote
  #3  
Old April 26th, 2002, 01:42 AM
Osprey Osprey is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Malta, Europe
Posts: 23 Osprey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 15 sec
Reputation Power: 0
Send a message via Yahoo to Osprey
Try using something like this after setting the recordset:

IF RS.Recordcount > 0 then
rs.movefirst
rs.edit
.......
rs.updtae
else
msgbox "No records found"
End If

Access 2000 works a little funny. Sometimes you have a recordset of, say, 10 records and it thinks there is only one record. To get the real number of records you have to do something like this:

rs.movelast
rs.movefirst

However, Access can tell if there are any records or not, it just can't tell the actual amount right away.

Reply With Quote
  #4  
Old April 26th, 2002, 07:00 AM
mab mab is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 39 mab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Thank you for the help!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Access 2000


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 2 hosted by Hostway