473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Refresh continuous form when combo box update

67 New Member
Hi,

I create form which default type as continuous form. I have put combo box in that form. When user select on dropdown list from combo box, I would like to show only record that meet condition in form.

Here is what I have tried, but I couldn't get what I expect
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboRevision_AfterUpdate()
  2.     Dim strNewRecord As String
  3.     strNewRecord = "SELECT * FROM history_request_expenditure " _
  4.         & " WHERE revision = '" _
  5.         & Me!cmboRevision.Value & "'"
  6.         Me.txtHidden.SetFocus
  7.         Me.RecordSource = strNewRecord
  8.         Me.Refresh
  9. End Sub
Please give me an idea on how to solve this problem.

Best regards,
Sophanna
Mar 14 '14 #1
6 2397
Seth Schrock
2,965 Recognized Expert Specialist
What is the RowSource for your combo box?
Mar 14 '14 #2
sophannaly
67 New Member
This is RowSource for my combo box:
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT (history_request_expenditure.revision) AS Expr1 FROM history_request_expenditure ORDER BY history_request_expenditure.revision;
Mar 14 '14 #3
Seth Schrock
2,965 Recognized Expert Specialist
Is the field Revision a Text data type?

You might try replacing line 8 in your OP with Me.Requery.
Mar 14 '14 #4
sophannaly
67 New Member
Hi,

I already tried with Me.Requery but it doesn't work.

Revision is double data type. I could see it change on the form(only one row change with the revision that I chose from dropdown list). And it still shows other records with other revision.

In my table, there are alot of record that has the same revision value and I want to show all that records in my form when I choose Revision from dropdown.
Mar 14 '14 #5
Seth Schrock
2,965 Recognized Expert Specialist
If Revision is a number data type (which Double is a number), then you need to remove the single quotes that you have in your string around the value of the combo box (the ones at the end of lines 4 and 5). Single quotes are only used for text, hash marks for dates, and nothing around numbers. See what that does.
Mar 14 '14 #6
sophannaly
67 New Member
Hi,
I already followed what you told me, but it still change only the first record and shows other revision too.
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboRevision_AfterUpdate()
  2.     Dim strNewRecord As String
  3.     strNewRecord = "SELECT * FROM history_request_expenditure " _
  4.         & " WHERE revision = " _
  5.         & Me!cboRevision.Value
  6.         Me.txtHidden.SetFocus
  7.         Me.RecordSource = strNewRecord
  8.         Me.Requery
  9. End Sub
Could anybody tell me how to solve this such as do I need to put loop or something else?
Mar 14 '14 #7

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

Similar topics

3
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
0
by: peterleeds | last post by:
Could anyone explain why Access 2003 is continuously calculating a continuous form, when it works perfectly in previous versions? On reading previous messages I gather that overlapping controls...
1
by: Marcia | last post by:
I have a combobox for types of music and a combobox for artists. The rowsource query for the artists combobox associates artists with different types of music. In the query I use the name of the...
5
by: WindAndWaves | last post by:
Hi Gurus I have a very simple question this time. I have a continuous form with a textbox (ID number) and a label. The label has a on_click event: msgbox me.id.value If I click on the...
10
by: DFS | last post by:
I'm sure this has been discussed before, but I'm too tired to hunt for it. I have a survey table containing questions with different answer scales. Some are 1 to 5, others are A,B,C, etc. I show...
20
by: Robert | last post by:
Need some help to stop me going around in circles on this one.... Have a nested subform (subform2) which simulates a continuous form for the record on the parent subform. Subform2 has rows of...
1
by: Bill | last post by:
Problem: Combo box data disappears from view when a requery is done See "Background" below for details on tables, forms & controls On a form, I want to use the setting of bound combo box C1...
2
by: Pablo | last post by:
I have a Continuous Form based on the following table: sku, description, categoryId, subCategoryId I restrict the initial dataset to include one value for categoryId, but it may include...
9
by: Patrick A | last post by:
All, I've got a continuous form with one field on it, with a comob
2
by: OllyJ | last post by:
Hi guys hope you can help... ...do you have any idea how you can set a control's (within a single record in a continuous form) property to visible=false depending on the outcome of an update...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.