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

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

18
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 2065
missinglinq
3,532 Expert 2GB
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 DumpNewRecordAndCloseButton
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,556 Expert Mod 16PB
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
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...
2
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...
4
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...
7
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....
0
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...
5
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...
30
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...
2
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...
13
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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
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...

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.