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

Forms question

There is probably a real easy answer to this one. Using access 2000, I have
a database with about 1000 client records in it. I am using a combo box in a
form which when I click in it, all of the client names are listed and
selectable, which is exactly what I want. When I click on a client name,
their name goes in the box, but the remaining client information doesn't
change, which of course has the potential in corrupting the entire database.
I want to be able to select a client name, and have the remaining
information for that client fill in automatically in the form. Any
suggestion on how to resolve this would be appreciated. Thanks in advance.

--
Terry
Nov 12 '05 #1
4 1442
Terry, you already have a Customers table (the row source for the combo
box). Presumably you are now talking about using that information in another
tables (such as orders for customers).

Open the Northwind sample database (installed with Access).
From the Tools menu, choose Relationships.
Notice how the Orders table has a CustomerID field, related back to the
Customers table.

Now Open the Orders form in design view.
Right-click the CustomerID combo box, and choose Properties.
On the Format tab, Column Count is 2, and Columns Widths is 0";2".
As a result the combo stores the CustomerID (the Bound Column property is
1), but displays the CustomerName.

You will also see how the customer names appear on the form. These fields
are not part of the Orders record. The RecordSource for the form is a query
that reads these from the Customers table. If a customer changes address,
you only have to do that once in the Customers table, and all the orders
automatically show the new address.

That is probably all you need, but in the case of Northwind they wanted to
allow for sending an order to a different address. As a result, they *do*
store the shipping address. If you look at the AfterUpdate event of the
CustomerID combo, you will see how they copy the current customer's address
into the "Ship To" address fields. If you really need to do that, you can
copy their approach.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Terry" <ve****@hotmail.com> wrote in message
news:Qn*******************@nnrp1.uunet.ca...
There is probably a real easy answer to this one. Using access 2000, I have a database with about 1000 client records in it. I am using a combo box in a form which when I click in it, all of the client names are listed and
selectable, which is exactly what I want. When I click on a client name,
their name goes in the box, but the remaining client information doesn't
change, which of course has the potential in corrupting the entire database. I want to be able to select a client name, and have the remaining
information for that client fill in automatically in the form. Any
suggestion on how to resolve this would be appreciated. Thanks in advance.

--
Terry

Nov 12 '05 #2
You don't mean, do you, that you intend to have redundant information
stored? If so, it'd be better to save in the record a link to the client
file, and show the client information in a subform or pick it up from
columns in the combo and move it to unbound fields on the form.

Larry Linson
Microsoft Access MVP

"Terry" <ve****@hotmail.com> wrote in message
news:Qn*******************@nnrp1.uunet.ca...
There is probably a real easy answer to this one. Using access 2000, I have a database with about 1000 client records in it. I am using a combo box in a form which when I click in it, all of the client names are listed and
selectable, which is exactly what I want. When I click on a client name,
their name goes in the box, but the remaining client information doesn't
change, which of course has the potential in corrupting the entire database. I want to be able to select a client name, and have the remaining
information for that client fill in automatically in the form. Any
suggestion on how to resolve this would be appreciated. Thanks in advance.

--
Terry

Nov 12 '05 #3
Actually Larry, what I'm trying to do is to make it real simple for a user
to retrieve information on a particular customer and not save/change any new
info at all (retrieve/display only) when using this particular form. There
is no need for a report or a printout.
I think Allen's suggestion is the way I need to go.
Thank you both, I'll let you know how I make out.
--
Terry
"Larry Linson" <bo*****@localhost.not> wrote in message
news:WY*****************@nwrddc02.gnilink.net...
You don't mean, do you, that you intend to have redundant information
stored? If so, it'd be better to save in the record a link to the client
file, and show the client information in a subform or pick it up from
columns in the combo and move it to unbound fields on the form.

Larry Linson
Microsoft Access MVP

"Terry" <ve****@hotmail.com> wrote in message
news:Qn*******************@nnrp1.uunet.ca...
There is probably a real easy answer to this one. Using access 2000, I have
a database with about 1000 client records in it. I am using a combo box in a
form which when I click in it, all of the client names are listed and
selectable, which is exactly what I want. When I click on a client name,
their name goes in the box, but the remaining client information doesn't
change, which of course has the potential in corrupting the entire

database.
I want to be able to select a client name, and have the remaining
information for that client fill in automatically in the form. Any
suggestion on how to resolve this would be appreciated. Thanks in

advance.
--
Terry


Nov 12 '05 #4
Terry wrote:
Actually Larry, what I'm trying to do is to make it real simple for a user
to retrieve information on a particular customer and not save/change any new
info at all (retrieve/display only) when using this particular form. There
is no need for a report or a printout.
I think Allen's suggestion is the way I need to go.
Thank you both, I'll let you know how I make out.
--
Terry


Let's say I have a customer table. I create a form for customers with all th
fields for data entry. The form's recordsource is Customers. I also have a
GoTo combo box where someone can select a customer and when a new customer is
selected, the record displayed is that customer.

Let's say the combo is called ComboBox. The Combo box displays
CustomerID(hidden) and CustName.

In the OnCurrent event, you would enter
Me.ComboBox = Me.CustomerID

In the AfterUpdate event of the combo you need some code to move to the record
selected.
You can copy this code into the event, change the name to your combobox name and
customerid field name
Dim rst As DAO.Recordset
Set rst = Me.Recordsetclone 'use the forms recordsource
rst.FindFirst "CustomerID = " & Me.ComboBox 'find the customer selected
If not rst.NoMatch then 'the record was found. you may have a filter where
it isn't in the list
Me.Bookmark = rst.bookmark 'found it, now set the bookmark
else
msgbox "Not found. Remove filer"
endif
rst.close
set rst = Nothing


Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: KK | last post by:
Windows Forms Inheritance, Incomplete? I was playing around with Windows Forms and found out this Forms Inheritance feature. The moment I saw that, I felt this can be used effectively if the...
2
by: KK | last post by:
** Posting it here cause after couple of days no body responded.** I was playing around with Windows Forms and found out this Forms Inheritance feature. The moment I saw that, I felt this can...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
4
by: Lumpierbritches | last post by:
Thank you once again for any and all assistance. I'm building an application that's getting quite bulky due to the number of forms, macros and procedures. I was wondering if there's a way to use 1...
1
by: Sunil Sabir | last post by:
Dear All, I have 4 web ASP.net Forms. I use a image control to move between these forms.The problem I am facing is that I cannot preserve the state of the form when moving between different...
18
by: Rippo | last post by:
Hi I am using role base forms authentication in asp.net and have come across a problem that I would like advice on. On a successful login a session variable is set to identify a user. This is...
15
by: Alex | last post by:
Does anybody know why VB.NET would omit the Forms collection available in previous versions versions of VB? I imagine that there must be a reason why they decided to do away with it, but I can't...
8
by: =?Utf-8?B?TFc=?= | last post by:
Hello! I am just learning about forms authentication so please excuse this basic question. I am using .NET 1.1 and C#. I have created my web.config file and my login.aspx and the associated cs...
1
by: Troy Bull | last post by:
Greetings I am trying to use a singleton to hold a group of forms. I have a MDIMaster form. I have a class called Forms; Forms is a singleton. I want to do something like the following. In...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.