473,738 Members | 4,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo Box Error in Row Source

132 New Member
I have a subform with 2 drop down boxes. The choices in the 2nd drop down box depend on the value of the first . When I run the subform on its own, it all works beautifully. However, when the I run the main form that calls the subform, I get a one of those parameter input required messages. As Greg Brady would say, "what gives"? Here is the code (query) from the subform:

SELECT SecondaryDisord er.[Secondary Disorder]
FROM SecondaryDisord er
WHERE (((SecondaryDis order.[Primary Disorder])=[forms]![case subform]![combo86]));
Jun 4 '07
36 2397
Rabbit
12,516 Recognized Expert Moderator MVP
You would put it in the after update event of the combo box that should trigger a change.

Take a look at this tutorial.
Jun 4 '07 #11
Proaccesspro
132 New Member
Are you trying to do this from the after update event of the combobox? Because that's where you have to do it from.

You can't just set the control source of the combobox to that SQL statement because it will never update.

And you said the "code (query) from the subform", I assume this is in reference to the row source of the combo box.
Yes.... the first box is titled combo86...I have this code in the after update event. The second combo box is titled combo90. what do i need to add?

Me![Combo90] = Null
Me![Combo90].Requery


[Forms]![case subform].Form.[Combo86]

End Sub
Jun 4 '07 #12
Proaccesspro
132 New Member
Yes.... the first box is titled combo86...I have this code in the after update event. The second combo box is titled combo90. what do i need to add?

Me![Combo90] = Null
Me![Combo90].Requery


[Forms]![case subform].Form.[Combo86]

End Sub
Here is the code I created.....It' s not quite working...

Private Sub Combo86_AfterUp date()
With Me![Combo86]
If IsNull(Me!Combo 90) Then
.RowSource = ""
Else
.RowSource = "Select[Secondary Disorder] FROM SecondaryDisord er WHERE [Primary Disorder]=" & Me!Combo86

End If
Call .Requery
End With


Ed Sub
Jun 4 '07 #13
Proaccesspro
132 New Member
Here is the code I created.....It' s not quite working...

Private Sub Combo86_AfterUp date()
With Me![Combo86]
If IsNull(Me!Combo 90) Then
.RowSource = ""
Else
.RowSource = "Select[Secondary Disorder] FROM SecondaryDisord er WHERE [Primary Disorder]=" & Me!Combo86

End If
Call .Requery
End With


Ed Sub

Here is my latest code....When run, the second combo box does not have any choices...in other words, i guess it is not finding a match
Jun 4 '07 #14
Rabbit
12,516 Recognized Expert Moderator MVP
You're using the wrong combo boxes. And some of your spacing is wrong. And this assumes that Combo86 and [Primary Disorder] are numbers.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo86_AfterUpdate()
  2. With Me![Combo90]
  3.    If IsNull(Me!Combo86) Then
  4.       .RowSource = ""
  5.    Else
  6.       .RowSource = "Select [Secondary Disorder] FROM SecondaryDisorder WHERE [Primary Disorder]=" & Me!Combo86
  7.    End If
  8.    Call .Requery
  9. End With
  10. End Sub
Jun 5 '07 #15
Proaccesspro
132 New Member
You're using the wrong combo boxes. And some of your spacing is wrong. And this assumes that Combo86 and [Primary Disorder] are numbers.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo86_AfterUpdate()
  2. With Me![Combo90]
  3.    If IsNull(Me!Combo86) Then
  4.       .RowSource = ""
  5.    Else
  6.       .RowSource = "Select [Secondary Disorder] FROM SecondaryDisorder WHERE [Primary Disorder]=" & Me!Combo86
  7.    End If
  8.    Call .Requery
  9. End With
  10. End Sub
They are NOT numbers.
Jun 5 '07 #16
Rabbit
12,516 Recognized Expert Moderator MVP
They are NOT numbers.
That's what your original code implied.

You'll need to use single quotes to tell it that it's text.

Expand|Select|Wrap|Line Numbers
  1. "Select [Secondary Disorder] FROM SecondaryDisorder WHERE [Primary Disorder]='" & Me!Combo86 & "'"
Jun 5 '07 #17
Proaccesspro
132 New Member
That's what your original code implied.

You'll need to use single quotes to tell it that it's text.

Expand|Select|Wrap|Line Numbers
  1. "Select [Secondary Disorder] FROM SecondaryDisorder WHERE [Primary Disorder]='" & Me!Combo86 & "'"
Here is what I have:

Private Sub Combo86_AfterUp date()
With Me![Combo90]
If IsNull(Me!Combo 86) Then
.RowSource = ""
Else
.RowSource = "Select [Secondary Disorder] FROM SecondaryDisord er WHERE [Primary Disorder]='" & Me!Combo86 & "'"
End If
Call .Requery
End With
End Sub
Jun 5 '07 #18
Proaccesspro
132 New Member
That's what your original code implied.

You'll need to use single quotes to tell it that it's text.

Expand|Select|Wrap|Line Numbers
  1. "Select [Secondary Disorder] FROM SecondaryDisorder WHERE [Primary Disorder]='" & Me!Combo86 & "'"
Here is what I have. Still no data in Combo90

Private Sub Combo86_AfterUp date()
With Me![Combo90]
If IsNull(Me!Combo 86) Then
.RowSource = ""
Else
.RowSource = "Select [Secondary Disorder] FROM SecondaryDisord er WHERE [Primary Disorder]='" & Me!Combo86 & "'"
End If
Call .Requery
End With
End Sub
Jun 5 '07 #19
Proaccesspro
132 New Member
Here is what I have. Still no data in Combo90

Private Sub Combo86_AfterUp date()
With Me![Combo90]
If IsNull(Me!Combo 86) Then
.RowSource = ""
Else
.RowSource = "Select [Secondary Disorder] FROM SecondaryDisord er WHERE [Primary Disorder]='" & Me!Combo86 & "'"
End If
Call .Requery
End With
End Sub
I copied EXACTLY what you wrote.....still NO cigar!!!

Private Sub Combo86_AfterUp date()
With Me![Combo90]
If IsNull(Me!Combo 86) Then
.RowSource = ""
Else
.RowSource = "Select [Secondary Disorder] FROM SecondaryDisord er WHERE [Primary Disorder]='" & Me!Combo86 & "'"
End If
Call .Requery
End With
End Sub
Jun 5 '07 #20

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

Similar topics

9
19482
by: Bob Alston | last post by:
I have a drop down combo box that gives the user to enter an item not in the list by adding it to the list. The list is a table. It works fine on Access2003 but fails on Access2002/XP. ON XP, it seems to work, shows the message that the entry has been added, then I get an Access error saying the item is not in the list. Here is my code: Private Sub Combo10_NotInList(NewData As String, Response As Integer) intAnswer = MsgBox("The...
4
1814
by: Larry Tate | last post by:
I am wanting to get those cool html error pages that ms produces when I hit an error in asp.net. For instance, when I get a compilation error I get an html error page that shows me the Description: Compiler Error Message: Source Error: Source File: The main thing I want is the Source Error. This give me a few lines of the
2
1875
by: MLH | last post by:
I invoked the combo-box wizard today, telling it to use a 4-table union query as a row-source for the combo-box it was assisting me in building. The error I got was without number and stated, "Data cannot be retrieved from the source you have selected. You must select a different table or query to continue in the wizard." just after I chose the query named qryAuthsOwnersAddnlOwnersLienholders4OneCar. Have any of you ever seen that error...
2
957
by: Eric | last post by:
Hello, I'm a little green in this area, so any suggested reading or examples is appreciated. In my release version of managed code, is there a way to know what command caused an exception? I know the message and source of the exception using the exception object. Is there a way to get the IL offset, so I know which command caused the
0
1751
by: Stimp | last post by:
I've created an aspx page called HistoryManage.aspx. The page works fine on my local machine but when I load it off the web I get the following strange error... Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
21
8546
by: Mark Rae | last post by:
Hi, I have an ASP.NET 2 web application (not web site) project and am using a web deployment project to deploy to the testing, then the production server. All has been working well for months now, but today after a recompilation, the app is throwing the error below when accessing a certain page, although there are no errors in the compilation process. Compilation Error Description: An error occurred during the compilation of a...
3
4748
by: John | last post by:
AC2007 I changed my combo's row source and then the autocomplete stopped working. The combo is two columns, bound to the first. First column is primary key (ID). Second column is a concatenation of two fields (Descrip & UserID). When I start typing letters of an existing description (Descrip), the combo does not autocomplete. If I select a choice from the combo, it
0
1217
bajajv
by: bajajv | last post by:
Hi, I am working with C++ builder 2007 and getting this error many times. Source file not found Forms.pas. Any idea what is this and how to solve this?
3
1496
by: Gord | last post by:
Is it possible to somehow add the option of "All" at the top of the list of a combo's drop down list? I'm hoping I don't have to go and re-jig the underlying table and/or query that the list is based on to get this to appear at the top of the list and can force it to happen directly with the combo box. Thanks, Gord
0
949
by: Ajobi Mike | last post by:
Error : Source file or directory missing or cannot be read. I got the above error while installing my SQL 2000 Server from a folder already copied on my desktop. Please how can I solve this problem so that I can install my SQL server Thanks
0
8788
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
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...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
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
6751
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
6053
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
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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.