Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old July 30th, 2004, 02:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Your welcome taraj, glad you got it going OK.

Bob

  #12 (permalink)  
Old August 24th, 2007, 03:45 PM
Authorized User
 
Join Date: Aug 2007
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello taraj & Bob!
I've been searching for my question everwhere for a few days and I finally came to this forum. This one is exactly like my problem and would love to find out how you guys solved this issue.
I've tried your suggested code, but can't past the "Dim rst As DAO.Recordset" line.
I placed this code in command button's property, and clicked on build event. It opend VB window, I pasted the whole script and this was what I had after I update the changes.
==code==
Private Sub Command8_Click()

Dim rst As DAO.Recordset

   Set rst = Me![client-query].Form.RecordsetClone
   rst.MoveFirst

    With rst
      .Edit
      !Name = True
      .Update
    End With
End Sub
==code end==
by the way- my Main form is called "Main-enter" and sub form is called "client-query". Field I'm trying to update here is "Name". But is it possible to update multiple fields (this I will ask again, after I can get the first part working)?

What am I missing? and when you say "set reference to the Microsoft DAO 3.6 Object Library", how do you do that?

Can you guys please help!!!! I going crazy with this one...
  #13 (permalink)  
Old August 27th, 2007, 09:45 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Make sure your DAO library is turn on. In any VBA code window, click Tools > References and make sure the Microsoft DAO 3.6 (or later) Object Libary is checked. Also, do not name any field "Name". That is a reserved property in Access. It can cause problems with VBA and queries. Rename the field "Name" to something else that is not reserved, e.g. strName, strFullName, etc.



Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
  #14 (permalink)  
Old August 27th, 2007, 10:22 AM
Authorized User
 
Join Date: Aug 2007
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SerranoG,
Thank you for that info! I didn't even check about the "name" field thing... So I guess I have to go back and change everything...
Also, when I go to my MS VB's window, "References" section is grayed out... What am I to do? I tried it with codes opened and without codes opened... Is there anything special I'm supposed to do?
THANKS FOR ALL YOUR HELP!
  #15 (permalink)  
Old August 27th, 2007, 12:53 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

"References" is grayed out?! Are you working with the MDB or an MDE? If the MDB, I don't know what would cause that unless you don't have proper permissions to edit the database fully.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
  #16 (permalink)  
Old May 22nd, 2008, 10:35 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I happened upon this thread, and it almost walks the question I need answered. Moderator, forgive me if this strays out of bounds.

I need to have a similar code that works like this:

When I click a command button, I need it to update a corresponding field in a table. IE: click command Button 1, field one in table "XXXX" registers a hit, or a number. One click, 1, two clicks, 2, etc., etc.

Is this doable?

Many thanks in advance!



  #17 (permalink)  
Old May 22nd, 2008, 10:37 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I happened upon this thread, and it almost walks the question I need answered. Moderator, forgive me if this strays out of bounds.

I need to have a similar code that works like this:

When I click a command button, I need it to update a corresponding field in a table. IE: click command Button 1, field 1 in table "TableName" registers a "hit", or a number. One click, 1, two clicks, 2, etc., etc.

Is this doable?

Many thanks in advance!







Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access help - VB Code for command button pari22 Access VBA 11 September 7th, 2007 11:13 AM
How to Click a web button using VB code AJD Access VBA 6 June 6th, 2006 07:32 AM
How to Click a button on a web page in VB code AJD Beginning VB 6 0 June 2nd, 2006 12:08 PM
cannot insert OLE command button event code janefu Excel VBA 1 January 10th, 2006 04:33 AM
VB 6: Coolbar Dropdown Button Code craigharrison Pro VB 6 0 October 16th, 2003 02:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.