473,614 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

show all records in my subform

1 New Member
hi all,
i'm a new programmer...
i use a combo box to filtering the records in my sub form..it was works...but when i want to show all records in my sub form it doesnt works..how it would be?please help me. thx..

private sub combo2_afterupd ate()
dim rs as object
if not isnull(me.combo 2) then
if me.dirty then
me.dirty = false
end if
set rs = me.recordsetclo ne
rs.findfirst "[field1] = '" & Me![combo] & "'"
if me![combo] = "ALL" ---> i'll make this item as an icon to show all records
???---> wat should i fill to this part, so i can show all records in my form
else
me.bookmark = rs.bookmark
end if
set rs = nothing
end if
end sub
Jun 13 '07 #1
1 4897
Lysander
344 Recognized Expert Contributor
hi all,
i'm a new programmer...
i use a combo box to filtering the records in my sub form..it was works...but when i want to show all records in my sub form it doesnt works..how it would be?please help me. thx..

private sub combo2_afterupd ate()
dim rs as object
if not isnull(me.combo 2) then
if me.dirty then
me.dirty = false
end if
set rs = me.recordsetclo ne
rs.findfirst "[field1] = '" & Me![combo] & "'"
if me![combo] = "ALL" ---> i'll make this item as an icon to show all records
???---> wat should i fill to this part, so i can show all records in my form
else
me.bookmark = rs.bookmark
end if
set rs = nothing
end if
end sub
The way I do this is to make the combo box a union query, e.g.
Expand|Select|Wrap|Line Numbers
  1. SELECT tblMandal.Mandal_ID, tblMandal.MandalName FROM tblMandal ORDER BY tblMandal.MandalName  union select 0,"<All>" from tblMandal;
  2.  
and then in the after_update event of the combo box
Expand|Select|Wrap|Line Numbers
  1. If cboMandal = 0 Then
  2.     Me.FilterOn = False
  3. Else
  4.     DoCmd.ApplyFilter , "Mandal_ID=" & cboMandal
  5. End If
  6.  
In this case, Mandal is an area in a country, like a US state or UK county, and the form is showing towns and villages, filtered by Mandal
Jun 13 '07 #2

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

Similar topics

1
2077
by: (Pete Cresswell) | last post by:
..DefaultView = Continuous Forms ..RecordSource = a query. While the form & subform are open, I can open up the .RecordSource query and see five records. If I insert a record, then re-open the query, there'll be four records - but the subform is only showing the one I just added.
4
2624
by: news.online.no | last post by:
In a query, I need too be able to show if a parent record has a child record. Using the query in a combo box too select record in a form. Thanks :)
2
2233
by: John Baker | last post by:
Hi: I have a sub form which i would like to show all the records selected from a table. There may well be over 100 of them. For reasons I cant fathom, the form will only show six, and then requires that you move using the record selection box to see any records below that. I would like the whole record set to be available using the vertical slider, since this is much more convenient for the user. Cab someone suggest what is wrong. The...
1
3465
by: Donna Sabol | last post by:
I have a form (frm_MAIN_RPT) that contains a combo box (Combo6) & subform (dbo_REQ_subform). The combo box is used to select the "cost center" data that will be displayed in the subform. From there, I have a button that runs a report based on which item I select in the subform. 1. The Combo Box correctly displays the list of cost centers within the combo box. 2. The subform, when opened separately, correctly displays the data for the...
1
4431
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have created a MainTable (and related form), which has an associated SubForm (popup) along with its underlying, separate Table. The tables' relationship is one to many respectively. The primary key
10
3610
by: Thelma Lubkin | last post by:
My form/subform combination that allows user to display 'ColorSet' records, move to other records via a selector, to add,delete, and edit them, and to manage the related 'Color' records from the subform is close to completion, but I still need help... The parent form's recordset has fields string integer COLORNAME CLASSSIZE and a few more that aren't relevant here.
4
2207
by: sparks | last post by:
I am trying to fix a database that someone did about 4 yrs ago in access97. The main table just contains demographics and is on the main form of the database. It has a subform on a tab that contains the other information. it is set 1 to 1 in the relationships. simplify if I can
1
2132
by: sjvandevoorde | last post by:
I need some help with a couple forms/test fields. Bare with me I have been out of the field for some time and only consider myself an intermediate user. The first one is a subfrom which lists records including Decrease and Increase field. I have two text fields which are suppose to total each of these fields. This subform is within another form which should be displaying the current balance. The subform text feilds are: Decrease - (I...
1
1890
by: premdasp | last post by:
Dear Sirs, I tried your valuable commands (below mentioned) but I got last record. Private Sub Form_Current() Dim rs As Recordset Set rs = .Form.RecordsetClone If rs.RecordCount Then rs.MoveLast .Form.Bookmark = rs.Bookmark
0
1841
by: jwbird | last post by:
I have a main form with multiple Subforms that are all displaying Datasheet information related to the Main form record. When I make changes/adds to the records(s) in the subform and tab to another subform, it saves those previous subform records fine, but when I make changes to the subform records and then change the mainform criteria, it doesn't save those subform records. I can use an event to prompt for saving the records on the...
0
8197
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8589
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6093
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5548
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.