473,378 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How do I control Record Selection on a Sub-Form?

4
Hi! I am new to Access and would appreciate some help.

I am develping a browser form which provides the user a view of some data (i.e. surname, firstname, dob) from a database using a query. I am trying to replace the standard system navigation bar with my own buttons which allow the user to click on it and move the record selection to "next" or "previous". I don't know how to attatch an image file to this message which would better explain what I am doing. Eventually I want to allow the user to select a delete button to "deactivate" a record (eg if a customer moves over seas), or type in a surname in a field which dynamically filters the query with the letters entered in the field, and to allow the user to double-click the required record which opens up a new form containing all the other information about the customer. Adding a dynamic search capability is also something I would like to include.

I am only practising with a small test example with the code as follows, simply to get the record selection to move with the click of a button:

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2.  
  3. Private Sub BtnNextRecord_Click()
  4. Dim Browser As Form
  5. Dim rstBrowser As DAO.Recordset
  6.  
  7.    Set Browser = Me.Contacts_Query_subform.Form
  8.    rstBrowser = Browser.Recordset
  9.    rstBrowser.MoveNext
  10.  
  11.  
  12. End Sub
I hope this makes some sense to someone and once I have the fully functional browser working I will post it for others to take advantage of.
Oct 17 '07 #1
7 2739
Scott Price
1,384 Expert 1GB
After reading your thread several times, I'm not quite sure what you specific question is!

However, this is a link to a Find As You Type utility that may help you in your dynamic search situation.

Welcome to the Scripts!

Regards,
Scott
Oct 17 '07 #2
hubs
4
Scott,

Thanks for the reply and I am sorry for the confusing post. I will break my problem down and focus on one issue at a time (having now re-read the guidelines).

Using Access 2003 on XP, I have created a form which includes a subform which is a datasheet using a query as its data source.

I am not using the form/subform relationship as normal (eg customer details on the form and order details in the subform). I have used the subform to list some of a customers details (i.e. surname, firstname, dob). Using the subform to list the customer details allows me to add control buttons on the form which I want to use to control the navigation or selection of records on the subform (datsheet).

That is, I want to use my own control buttons to navigate the subform (customers datasheet), and not use the standard navigation tool.

I notice on the message posting toolbar an insert image button, however, I don't know to use this, but getting you a coy of my form would more clearly explain what I am trying to achieve.

Finally, thankyou for your link to dynamic filtering. This will be very helpful when I get to that aspect of my development.

Thanks again

Peter
Oct 18 '07 #3
Scott Price
1,384 Expert 1GB
Hi Peter,

Does the code that you posted not work? And if not, what error message(s) does it give?

Good eve,

Scott
Oct 18 '07 #4
hubs
4
Scott,

Sorry, no the code (above) does not work. I receive the following Microsoft Visual Basic error:

Compile error: Invalid use of property

Regards

Peter
Oct 18 '07 #5
Scott Price
1,384 Expert 1GB
Try using the Set method for the line of code that gives you that error message... I.e
Expand|Select|Wrap|Line Numbers
  1. Set rstBrowser = Browser.Recordset
.

Regards,
Scott
Oct 18 '07 #6
hubs
4
Scott,

Sorry for taking so long replying - out of the office and weekend.

Thankyou very much for the solution, it worked a treat.

Regards

Peter
Oct 22 '07 #7
Jim Doherty
897 Expert 512MB
Scott,

Thanks for the reply and I am sorry for the confusing post. I will break my problem down and focus on one issue at a time (having now re-read the guidelines).

Using Access 2003 on XP, I have created a form which includes a subform which is a datasheet using a query as its data source.

I am not using the form/subform relationship as normal (eg customer details on the form and order details in the subform). I have used the subform to list some of a customers details (i.e. surname, firstname, dob). Using the subform to list the customer details allows me to add control buttons on the form which I want to use to control the navigation or selection of records on the subform (datsheet).

That is, I want to use my own control buttons to navigate the subform (customers datasheet), and not use the standard navigation tool.

I notice on the message posting toolbar an insert image button, however, I don't know to use this, but getting you a coy of my form would more clearly explain what I am trying to achieve.

Finally, thankyou for your link to dynamic filtering. This will be very helpful when I get to that aspect of my development.

Thanks again

Peter
Peter,

In addition to Scotts advice as an aide to the principle of this thread if you PM me (private message) I will send you a database I knocked up for newbies that demonstrates technique how to search multiple fields in combination within the environment of a main form and a subform using minimal code that builds the where clause of an SQL statement dynamically. Included within that is how to dynamically set a reports recordsource based on your search return and an also the opening of a separate popup form to show the main data of the record selected in the subform.

The only thing it doesnt have presently are the custom navigation buttons but that is relatively easy thing to incorporate and I may include that into the subform elements if thats what you need to proceed.

There is also an output to excel of the same dataset where it turns on excel column headers so that you can deal with the data externally if you wish also tab page useage, listbox referencing and adding records from the same unbound main form where a record might not exist.

I'm building this thing incrementally as a learning reference for newbs much as anything else.

Regards

Jim :)
Oct 22 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Paul C. | last post by:
Hi folks. I have a WebControl TextBox which I would like to force to select all it's text during PreRender. My problem is that I don't know how to do this. I already have a reference to the...
2
by: carmen | last post by:
i have the folowing code Dim y As New frmCobranz Dim MyReport As New RPTCobranz MyReport.DataDefinition.RecordSelectionFormula = "{CobH.RelNbr}= y.txtNoRelac.Text...
0
by: Jasper Jones | last post by:
I have a Crystal report that shows me a list of sales and which customer bought them, I would like to get a distinct list of customers, is this possible with crystal's formulas? This is my...
3
by: Alison Givens | last post by:
Hi, I want two Session values in my record selection query. The come out of an other webform. When I do it hardcoded, it works. How dow I do this with the Session values? Hardcoded: Dim...
1
by: Simon | last post by:
Dear reader, With a combobox I can go to a selected record picked in the pull down list. And in the same time the record navigation field shows the selected record number from the...
6
by: Edgar | last post by:
Hi, I need some advise on how to automate record selection on a stored proc. Here is my situation. I have a stored proc that I used on Crystal reports with two parameters - Acctcode and...
0
by: (PeteCresswell) | last post by:
Got a TreeView control on the screen. User clicks a node, screen loads details for that node. Screen has two modes: Browse and Edit. If the user clicks "Edit", I set Tree.Enabled=False and...
2
jimleon
by: jimleon | last post by:
Hello All I am trying to select a record to edit using the following commands query = "select * from companies where name=" & Forms!! Set record = dbbooking.OpenRecordset(query) ...
16
by: freedom | last post by:
How to use the record selection formula in CR9 programatically using vb.net? I have a combo box that displays the date. If I select date, I can generate a report based on the selected date. Thanks in...
5
by: =?Utf-8?B?Um9iZXJ0IFNtaXRo?= | last post by:
Hi, I wish to create a repeater control in c#.net that allows for the selection of rows, any idea how this can be done. Regards Robert
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.