Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271

    Unanswered: Update or refresh or requery

    I have an order form we use. It has a database and a subform of all the possible products that can be ordered.

    I have another form in the form to enter new products in the database (FrmAddNewProducts). Once I enter the price in new products form, I would like the new products I entered to show up in my main form FrmOrdering. What is the best way to enter code and where to put the code??

    Thank You,
    Michael
    Gotta to do some code

  2. #2
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    I entered

    Forms!FrmOrdering.Refresh
    Forms!FrmOrdering.Requery
    in the after update of the price control in my FrmAddNewProducts, and it does not update?? I have to close the FrmOrdering form before the new products show up. What a pain!!!


    Any Ideas?
    Michael
    Gotta to do some code

  3. #3
    Join Date
    Sep 2003
    Posts
    41

    requery

    make sure that after you enter the new price you force a save of that record to the database before doing the requery


    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    [forms]![yourformname]![your combo box or list box or text box control name].requery

    This should do it with some modifications to match your situation.

  4. #4
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    Still no luck!

    Does it make a difference that it is in a subform?
    I have a form FrmOrdering
    then I use tabs to different things:
    a subform SbFrmOrderssubform (This is the product to order)
    I have FrmAddNewProduct (so anyone can enter new products.)
    Next SbFrmProducts (So people can look up products)

    Once I enter the new products, I would like them to be usable in SbFrmOrderssubform.

    Thank You,
    Michael
    Gotta to do some code

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    gotta rush to do some TV.

    have a look at the end of this to see if it gives you any inspiration.

    izy
    currently using SS 2008R2

  6. #6
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    This didn't help at all??


    Anyone else?
    Thank You,
    Michael
    Gotta to do some code

  7. #7
    Join Date
    Mar 2004
    Posts
    77
    try refreshing the subform.

  8. #8
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    I tried refreshing the subform, that did not work.

    Here is what is going on so far:
    1- I enter an order in my main form [FrmOrdering]
    2- It then takes me to a subform [SbfrmOrderssubform] where I enter the products to order.
    3- If I enter an item that does not exsist I have a message box that comes up and asks if I would like to enter this new item. If yes, then it opens a form where you enter products [FrmAddNewProducts].
    4- I enter the new product and close.
    5- It takes me back to my subform to enter the product. When I try to enter the new product, it gives me my message bax again????? If I say no to the message box this time, it enters by default the new product????? Hello!! What is going on? Any help would be greatly appreciated??

    Michael
    Gotta to do some code

  9. #9
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    Why if I hit NO it enters the data?

    Michael
    Gotta to do some code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •