Re: Combination box





This still isn't making sense to me.

'The name of the field Produced amount is Monday (eh???). I also have a
field
tuesday, wedensday and so on, where the same thing should happen'.

Are you saying that you have Fields in your table called Monday, Tuesday
Wednesday etc?
(if yes, you may need to check your database design in the TableDesign
newsgroup)
or are you saying that you have text boxes in an unbound form which you have
named (in Properties) Monday, Tuesday, Wednesday

Does Tbl320 also contain a field which contains numbers (1, 2, 3 etc) for
each week? Or does it contain dates. Are you trying to add a new new record
to Tbl320 or edit a record already there? ie are you trying to run an
append or an update query?

Is tbl320 set out like some kind of spread*** with the weekdays being used
as field names and the week numbers typed down the side?

Is there a reason why you can't base a form on this table and enter the data
directly into the table via the form which you can filter using a combo?

Or do you want your form to total the text boxes Monday, Tuesday Wednesday
because this is an Unbound text box and enter the results into your Tbl320
in a field called ProducedAmount next to the Week field with the chosen
number

I think there may be something you have missed out of your explanation.
Evi










"Ticotion" <Ticotion@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:313F6B6B-2147-447F-ADB9-5FFF4F22A307@xxxxxxxxxxxxxxxx
Hi Evi

Name of combo boks is CBO2 which looks up week values in tbl_320.

The name of the field Produced amount is Monday. I also have a field
tuesday, wedensday and so on, where the same thing should happen.

When a user inputs numbers in the "Monday" field or Tuesday field and so
on,
the user should by pressing a button save the input values for the week
choosen, in tbl_320.

If nothing is listed then nothing should be written in the table.

I've tried to use your code but can't realyy get it to work.

Thanks for your help
Ticotion

"Evi" wrote:

It might help you to give details such as name of combo box, name of
table,
name of field for Produced Amount. it will make it easier for you to
read
the code too. It also saves us having to assign names to them.

Since this is a simple coding problem, I assume you know how to use
events.

So the code in the After Update Event for the combo will be something
like
this

Me.ProducedAmount = (DLookup("[LookedUpValue]",
"DatasourceTable2","[WeekNumber]=" & Me.MyCombosName)

You'll need to put in the real names

You will need to decide what to do if there is nothing listed for that
WeekNumber in your datasource table - look up the NZ function for
instance.
Evi

"Ticotion" <Ticotion@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5C75349C-39F8-4950-A88D-ED2D10D2E93E@xxxxxxxxxxxxxxxx
Hi

I have a simple form coding problem.

I have a combination box that contains week numbers. Furthermore I
have a
field for produced amount. When a user selects a weeknumber I want the
form
to find the value in the datasource tabel, so that the input in the
produced
amount field are saved here. Can you help me?

Thank you for your help and input
Ticotion





.


Loading