473,625 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add two fields to a single combobox and how to modify the close form button

18 New Member
Guys, I have two questions.

(a) How do I add two fields of the same table to a single combo box. For example if I have two fields ID1 and ID2 in a table called Identification, than how should I design a combobox in a form such that when I scroll down I get to see both the ID's.

(b) I have a (Close Form) button on a form. Let's say I am adding a new record from a form and I am half way filling up everything and suddenly if I change my mind not to save the record than I have a button to close it, but the problem is if I hit the close form button it still saves the record. How do I make the button into where it will just close but not save the record.

Any help appreciated.
Apr 2 '08 #1
2 2076
missinglinq
3,532 Recognized Expert Specialist
Question A

  1. Place combobox on form
  2. Select I want combobox to look up values in a table or query.
  3. Follow prompts
  4. Select Identification table
  5. Select fields ID1 and ID2
  6. Follow prompts to finish combobox
Question B

Place button on form, naming it DumpNewRecordAn dCloseButton
Place this code behind it:

Expand|Select|Wrap|Line Numbers
  1. Private Sub DumpNewRecordAndCloseButton_Click()
  2.  If Me.NewRecord Then
  3.    Me.Undo
  4.    DoCmd.Close acForm, Me.Name
  5.  End If
  6.  End Sub
Welcome to bytes!

Linq ;0)>
Apr 2 '08 #2
NeoPa
32,567 Recognized Expert Moderator MVP
Please keep separate questions in their own threads in future.

This makes it easier to manage and to find later.

Admin.
Apr 3 '08 #3

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

Similar topics

3
22247
by: Bobbak | last post by:
Hello All, I was wondering if it is at all possible to have a single combo box update multiple fields in a single record. For example I have created an Employee Info form, and in that form there's a combo box (called "DirectorName") that contains the Directors Info that is connected to a table called "tblDirector" that has the Director's First Name, Last Name, and Director ID. Now all three fields appear in the one combo box (which the...
2
4010
by: Cro | last post by:
Dear Access Developers, I am developing a form with 'default view' set to "continuous forms". I am suffering with a problem I can't yet see a solution too. Each record has many fields. Two fields I would like to add a little extra functionality to are a check box and a combo box. More explicitly, I would like the 'enabled' property of a combo box control to be dependent on the value of a check box (a 'yes/no' field) in the same...
4
1850
by: weitzag | last post by:
I have a combobox on a form with the following row source SQL query. SELECT tblSupplyType.SupplyName, tblSupplyType.PWS_ID FROM tblSupplyType WHERE (((tblSupplyType.SupplyName)=Forms!!bxPWSName2)); After I close the form, Access rewrites the query to this: SELECT tblSupplyType.SupplyName, tblSupplyType.PWS_ID FROM tblSupplyType
7
20762
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well. The control populates well, both the display values, and selected values. However, when i try to "set" the SelectedValue or SelectedIndex properties, nothing happens.... The default blank value in the ComboBox is always selected. My code is: ...
0
2039
by: Doug | last post by:
This is a repost of an item that I still cannot resolve. I have 3 combo boxes. The first leads to the second to the third. When I have selected a value in the second box, the third box shows the available information based on the second combo box selection. But if I change my mind and select a different item in the second box, after the third box has been populated, the third box still retains the information that was previously...
5
2147
by: ross kerr | last post by:
Hi All, I am extending the combobox to create a control that selects an item based on the text the user is typing into the text area of the control. I have an issue that occurs only when i drop down the combo box as the users typing. When the on leave event is fired the value in the selected
30
4564
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a corresponding field in the lookup table. In my data table we store the ID in what I will call the 'key' field. == Description of the desired operation:
2
946
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about making this work...
13
4799
by: no1zson | last post by:
I am a beginner here, still in my first Java class, so I hope this question is not so simple as to offend anyone, but I am finishing up my cd inventory program. Adding some GUI buttons to manipulate data in my JList. JList is beyond the scope of my class so I am finding help hard to come by. I only have two weeks of class left, so it is too late to go back to my array now. It is sink or swim with what I have. :o) For my question ... I...
0
8251
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
8688
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
8635
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...
1
8352
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
7178
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6115
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
5570
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
4085
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...
2
1496
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.