Results 1 to 3 of 3
  1. #1
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228

    Need help with VBA code here

    I am trying to make an estimator application for a friend who is in the business of fabricating aluminium-and-glass casements. I have managed to break down the requirements into a neat little database that starts with products and breaks them down into components and parts and applies formulas on the parts to compute the precise lengths of each raw material based on the measurements of each product on order. I want to save the computed results in another table called "Requirements" that will have the [ORDERID]+[ORDERDETAILSID]+[PRODUCTID]+[COMPONENTID]+[PARTID]+[FORMULAID] as the composite key. This will enable me to query for any particular combination of requirements as needed.



    Where I am stuck with my rusty VBA skills (I used Access extensively in the mid-1990s), is how best to design a form where the user can define each formula e.g. PartXLength = "(Height / 2) -7.5" or Rivets = 4. I am thinking instead of saving the formula as a multi-field row, it would be best to save it as a string field and then translate it when needed.

    Question is: How to write all the code needed to translate very different formula strings?

    Attached is the zipped mdb. I have had to strip it of all the forms and queries to get it to the 500Kb limit, so bear with me if it does not make much sense.

    Any help will be appreciated.

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209
    Take a look at the usage of EVAL() Function here: Custom Calculator and Eval() Function.

    The Eval() Function can evaluate the expressions written in string format and return their result.

  3. #3
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    I think that is exactly what I was looking for. I had seen some articles on the EVAL function upon searching for help, but none was as simple and targeted as this one. Thanks, Mr APR PIllai.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help with code
    By jfuller in forum Programming
    Replies: 5
    Last Post: 06-02-2011, 10:24 AM
  2. Word code in Access - How to modify my current code
    By Alexandre Cote in forum Programming
    Replies: 0
    Last Post: 11-15-2010, 08:26 AM
  3. Code in combobox, code in text box
    By float in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:12 AM
  4. Need code
    By Patience in forum Access
    Replies: 8
    Last Post: 07-01-2010, 07:26 AM
  5. Access 2003 code vs Access 2007 Code
    By ralphjramirez in forum Access
    Replies: 5
    Last Post: 11-23-2009, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums