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

How to fill a for automaticly(just some boxes)

Hello. I hope tht someone is going to be able tohelp me, so here is my
problem.
I have a main table with ID(primary Key),Brend,Model,Price.
Then I have a sales table which is filled with a sales form. In the
sales form i have ID,Size and Date. So the sales table is filled with
ID,Size and Date.
I would like to put one more box for the price in the form but like
this: When i write the ID and press enter i would go to the second box
to fill the size BUT THE PRICE BOX WOULD FILL AUTOMATICLY(it would take
the price of that ID from the main table)! And I would also like to
write a new price over that one if that price isn't good for me(let's
say if I give a discount or something like that). How can I do that?

Marko

Nov 13 '05 #1
4 1566

"marko" <ma*****@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hello. I hope tht someone is going to be able tohelp me, so here is my
problem.
I have a main table with ID(primary Key),Brend,Model,Price.
Then I have a sales table which is filled with a sales form. In the
sales form i have ID,Size and Date. So the sales table is filled with
ID,Size and Date.
I would like to put one more box for the price in the form but like
this: When i write the ID and press enter i would go to the second box
to fill the size BUT THE PRICE BOX WOULD FILL AUTOMATICLY(it would take
the price of that ID from the main table)! And I would also like to
write a new price over that one if that price isn't good for me(let's
say if I give a discount or something like that). How can I do that?

Marko


Make ID a ComboBox and in the RowSource include two columns. One for ID and one
for Price. Make the width of the Price column zero so it does not show. Then
in the AfterUpdate event of the ComboBox have code...

Me.Price = Me.ID.Column(1)

That will "push" the value of the hidden column into the Price control on your
form, but you will still be able to change it manually.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
If it is not complicated for you, can you explain to me what do i
exactly have to do because i'm a beginner in access.
How can i include 2 columns in the row source? Do i make a query?
What does Column(1) stand for?
Please help me if you can.
Marko

Nov 13 '05 #3
"marko" <ma*****@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
If it is not complicated for you, can you explain to me what do i
exactly have to do because i'm a beginner in access.
How can i include 2 columns in the row source? Do i make a query?
What does Column(1) stand for?
Please help me if you can.


The relevant properties of the ComboBox are...

RowSourceType
RowSource
ColumnCount
BoundColumn
ColumnWidths
ControlSource

Find the RowSourceType property on the data tab of the property sheet and make
sure it is set to Table/Query. Then move to the RowSource property and click
the builder [...] button to the right side of it. That will take you to a query
designer window where you can build your two column query. Add your table and
then put ID into the first column and Price into the second one. Close and
save. This will return you to the form designer and you will now have a valid
SQL string in the RowSource property. This is the same as a saved query except
you won't see it in the db query window.

Now set the BoundColumn property to 1. This is what causes the ComboBox to
store the ID as part of your record. The ControlSource property should be set
to ID because that is the field where the value will be saved.

Now move to the Format tab of the property sheet. Set ColumnCount to 2 (because
your RowSource has two columns) and set the ColumnWidths to n";0" (replacing n
with how wide you want the ID column to be in the drop-down list). Having zero
in the second entry will cause the Price column to be hidden.

Finally move to the Event tab of the property sheet. Enter [Event Procedure]
into the AfterUpdate box and then press the builder [...] button. This will
take you to the VBA code editor. Your cursor will automatically be positioned
between two pre-made lines that define the code procedure that will be executed
whenever the value in the ComboBox is changed. Between those lines is where you
enter...

Me!Price = Me!ID.Column(1)

In this context column numbering begins with zero so Column(1) is actually the
second (hidden) column containing the price. You should now find that whenever
you enter an ID into the ComboBox that the correct price is automatically copied
into the Price control on your form.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #4
THANKS A MILLION!!!!!!!!!!! :)))
Marko

Nov 13 '05 #5

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

Similar topics

4
by: Barry Margolin | last post by:
Can I do the following with Javascript? My state has a web site that can be used for online filing for unemployment benefits. Every week I have to go to the site and fill in a form, checking...
3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
0
by: Jim | last post by:
Hi, there, I am a beginner on Access. I have been taking so long time to try to figure out his, but so far, no clues. I want to select 2 combo boxes and Access will automatically fill in...
5
by: John Sheppard | last post by:
Hi there Does anyone know how to fill a bound textbox automaticlly. In an unbound textbox I would put in the control source =Sum(price, tax) (or some such function) and access updates it...
2
by: Joanne Lewis | last post by:
I am having a great deal of difficulty with a form. Basically, I would like to enter an account # and have the account #, patient first name, and patient last name automatically fill. The form...
18
by: Vayse | last post by:
Has anyone an example of filling a combo box with a data reader? Thanks Vayse
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
2
by: Martin Arvidsson, Visual Systems AB | last post by:
Hi! I am constructing a program that will massverify some reports. How ever there is a message dialog comming up saying that the report is up to date or needs change. Is there a way to...
1
by: bytesFTW99 | last post by:
I have been struggling with this for some time can anyone help out? just trying to have 3 dropdown boxes that fill depending on what is selected, then in some cases click a button and have the second...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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
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...
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...

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.