473,396 Members | 1,773 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,396 software developers and data experts.

Clearing combo box using VBA generates error

15
Hello,

I would like to clear comboBox2 once a new value is chosen in comboBox1 (comboBox2 values depend on comboBox1).

I tried the following VBA in after update event:

Expand|Select|Wrap|Line Numbers
  1. Me.comboboxName = ""
  2. Me.comboboxName = Null 
but it generates an error saying that a Null value was attempted to be assigned to a variable different from Variant (run-time error '3162').

I would appreciate help how to solve the problem.

MS Access 2007

Marcin
Jul 16 '15 #1
1 920
zmbd
5,501 Expert Mod 4TB
instead, if CBO2 feeds from CBO1 then in CBO1_AfterUpdate event force CBO2.Requery. Two things will happen, your control will clear and your recordset for CBO2 will update based on CBO1
Jul 16 '15 #2

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

Similar topics

2
by: ABinBoston | last post by:
I have a macro that uses the SendKeys function to send F9 - to auto save a record. The Application runs perfectly on many PCs, but on one I get the following error. SendKeys Action Requires...
2
by: gorden blom | last post by:
Hi, I'm a student who's working on a school project about ASP.NET / C#. I'm having some problems with my class. I want to create an ArrayList filled with results from a DataReader. It gives me...
2
by: Ken Powers | last post by:
Hello everyone, I'm getting a strange error when I try to bind a combo box to a Dataset. Here's my code! Private Sub Get_Data() Try Dim sqlcmd = New SqlCommand("Select * from Utility order...
0
by: Ken Powers | last post by:
Hello everyone, Sorry about the repost, my second VB.NET App is done with the exception of this error. I'm getting a strange error when I try to bind a combo box to a Dataset. Here's my code! ...
4
by: Shyguy | last post by:
I have a combo box that searches for records in the database. When a name is typed in that is not in the database, Access shows a message box that says, The test you entered isn't an item in...
5
by: Ryan | last post by:
A binding navigator control adds the following code for when the Save button is clicked: Me.Validate() Me.UserBindingSource.EndEdit() Me.UserTableAdapter.Update(Me.UserDataSet.User)" You can...
0
by: RAM | last post by:
Hello, I have created simple ASP.NET application with master page MIMStock.master: <%@ Master Language="C#" AutoEventWireup="true" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
15
by: deanndra | last post by:
I thought I had it figured out yesterday. WRONG! I have 2 combo boxes, CBUnit and CBSub. When value is clicked within CBUnit, it should bring up corresponding sub-values in CBSub. These combo boxes...
1
by: brent78 | last post by:
I have 2 questions. 1)How can I do a setfocus on the first item in a combo box populated with a query. I figured I could somehow use the index of 0 but I can't figure out the syntax to do it....
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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...
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,...

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.