Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 17th, 2004, 02:50 AM
Registered User
Join Date: May 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Navigating between Forms

Hi All,
I am very new to VBA. I am stuck up with one issue for more than a week:(.
My requirement is simple. on opening the access application, a form(Say Name=Products) should pop up with 2 fields (product ID and product Name) from a table called Products. The display should be in a table like fashion. There will be a detail button, Selecting a record and on clicking the button should take the user to another form(ProductDetails) which has some 10 fields pulling all the details of the selected record from the same table.
I am using a sub form named ProductSummary in the Form named Products to represent the data in a table fashion.
I am unable to display the details of the selected record in the second form. I have tried many things - Recordset, Recordsetclone, bookmark and what not. Since I am new to VBA, I am not sure whether I am using it correctly.
Pleez help me..
Thanks in advance,

Reply With Quote
  #2 (permalink)  
Old May 21st, 2004, 11:28 PM
Authorized User
Join Date: Oct 2003
Location: Toronto, Ontario, Canada.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Rakesh,
Not sure if I understand 100%...but, here goes.
You can generate an SQL statement, to attach to the "RecordSource" property of the subform, to filter it accordingly.

SQL = "SELECT tblProducts.* " & _
       "FROM tblProducts " & _
       "WHERE tblProducts.ProductID =" & Me.ProductID & ";"

ProductDetails.Form.RecordSource = SQL

or, use the filter property of the subform.

ProductDetails.Form.Filter = Me.ProductID
ProductDetails.Form.FilterOn = True

I believe, my syntax is correct in both cases.
I used "ProductDetails" to reference the subform, it should be whatever you called it on the main form, not necessarily its actual name.
Hope this helps Rakesh, good luck!

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in navigating kk2ka4 XSLT 1 November 12th, 2008 01:45 AM
Navigating Recordsets w/out specifying name Tethys Access VBA 7 December 5th, 2005 04:47 PM
Navigating records in a database don baroo Classic ASP Databases 3 December 8th, 2004 07:09 AM
navigating a dataset ranakdinesh BOOK: Professional C#, 2nd and 3rd Editions 4 June 1st, 2004 11:37 PM
Navigating thru DataGrid Object chiefouko VB Databases Basics 0 July 24th, 2003 04:56 AM

All times are GMT -4. The time now is 07:05 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.