RE: Update table from form using vba

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Noemi (Noemi_at_discussions.microsoft.com)
Date: 02/24/05


Date: Thu, 24 Feb 2005 14:33:01 -0800

Hi Sergey
Thank you for your help.
regarding my search.
Lets say we have three brands of tea and each brand has 3 different
flavours. We have the ability to chose one flavour from each brand of tea to
place an order.
Each order requires an order number but the order numbers differ based on a
number given to each flavour.
In our table we want to have in column that shows the flavour of the tea but
before adding the order we need to search for the last order placed for the
flavours so the new order numbers will be the next sequence.
ie
Following are 3 brands with 3 flavours
(Combobox) (Selections available)
Lipton = Rasberry (931), Lemon(932), Chamomile(933)
Twinings = Cranberry(921), quiet Chamomile(922), Strawberry(923)
Dilmah = Earl Grey(941), Peppermint(942), Orange(943)
We decide to choose:
Lipton = Rasberry(which = 931)
Twinings = Strawberry(which = 923)
The table will show:
Order No Flavour
9310001 Rasberry
9230001 Strawberry
9410001 Earl Grey
new order inserted should be after checking current details in table:
Order No Flavour
9310002 Rasberry
9230002 Strawberry
Add when we do another order before updating the table a search will be
completed to find the last order number for specific Flavour and then add a 1
to the order number:
ie
Rasberry = new order number would be 9310003

I hope this explains my query.
Thank you in advance for your help

"Sergey Poberezovskiy" wrote:

> I did not quite understand what kind of search you need to
> perform, but if you need to just put data in the table,
> then you can use either DAO or ADO library to accomplish
> the task. For example, by using DAO:
>
> Private Sub myButton_Click()
> Dim rs As DAO.Recordset
> Set rs = CurrentDb.OpenRecordset("myTable")
> ' if you need to add new record
> rs.AddNew
> rs!Field1 = txtField1
> ...
> rs!FieldN = txtFieldN
> rs!State = cmbMelb
> rs.Update
> ' Now update Sydney
> rs.AddNew
> rs!Field1 = txtField1
> ...
> rs!FieldN = txtFieldN
> rs!State = cmbSydn
> rs.Update
> ' Close the recordset
> rs.Close
> End Sub
>
>
> >-----Original Message-----
> >We have a form which nees to update a table however I
> need to complete the
> >coding in VBA but everything I enter does not work. Not
> only does the table
> >need to be populated using text and combo boxes but I
> need to do a serach
> >before adding the data into the table as we have a few
> combo boxes with info
> >that needs to be added under the same feild in the table.
> >example: 2 combo boxes called melb and syd. melb has
> numbers 9324, 9334,
> >9344 while syd has 9201, 9206, 9251. From melb comobox we
> select 9324 and syd
> >we select 9201 then we need to records to be entered into
> the table with the
> >same details from all the other text boxes etc but the
> table field called
> >state will need to show the 9324 as one record and 9201
> as the next record.
> >
> >I would greatlly appreciate any help as I have tried all
> different versions
> >for the past 2 weeks.
> >.
> >
>



Relevant Pages

  • RE: Update table from form using vba
    ... If you need a separate order numbers for different brands ... BrandID ... OrderNo ... We have the ability to chose one flavour from ...
    (microsoft.public.access.formscoding)
  • Re: New Zealand medicine?
    ... I love Manuka Honey on my toast! ... I'd say it's worse off being used in lesser quality tea because the ... fresh distinctive flavour. ... a delicate balance... ...
    (rec.food.drink.tea)
  • Re: What are you drinking Christmas morning?
    ... I shared three different teas with my sister and her husband ... on Christmas morning. ... has a very smokey and spicey flavour. ... It's a very dark fermented tea with a strong ...
    (rec.food.drink.tea)
  • Re: Need some new teas, your favorites?
    ... With regards to some nice full flavoured black teas I'd like to suggest ... their full bodied subtlely sweet flavour. ... Most good tea vendor's will carry a variety of Yunnan's. ... You may consider a white tea for sipping at home. ...
    (rec.food.drink.tea)
  • Hedleys Tea
    ... The blackcurrant flavour is somewhat cartoonish and the ... tea flavour underneath it isn't really very vivid. ... C'est suisse, et tres, tres precis." ...
    (rec.food.drink.tea)