is it posible to convert text in a table to a query with vba code

  • Thread starter Thread starter thread
  • Start date Start date
Hi All,
i'm trying to convert a formula in a table to an SQL sentence,is it
posible?

Probably. Depends on the formula and what you want to do with it. Care to give
us a hand?

John W. Vinson [MVP]
 
Probably. Depends on the formula and what you want to do with it. Care to give
us a hand?

John W. Vinson [MVP]

its hard to define becaouse basicly,the formula will be build based on
some excel file
so basicly the question here is if i can use a record string as a
query
becaouse the formula with be stored as a record field and when i would
like to open application it will be converted to a query for the
application
 
its hard to define becaouse basicly,the formula will be build based on
some excel file
so basicly the question here is if i can use a record string as a
query
becaouse the formula with be stored as a record field and when i would
like to open application it will be converted to a query for the
application

You'll need VBA code to take the value from the text field and construct a
valid SQL string. Since you don't provide any guidance or constraints on what
might be in the field, all I can say is Good Luck. Access is not a version of
Excel, and what would be a valid Excel cell expression might or might not be
valid SQL - with the emphasis on might NOT.

John W. Vinson [MVP]
 
You'll need VBA code to take the value from the text field and construct a
valid SQL string. Since you don't provide any guidance or constraints on what
might be in the field, all I can say is Good Luck. Access is not a version of
Excel, and what would be a valid Excel cell expression might or might not be
valid SQL - with the emphasis on might NOT.

John W. Vinson [MVP]- -

- -

let me give you an example,we have benefit item costs for several of
compencies
every company submitting its own benefit module
i need to upload to excel the module of the cost of every company
some based contribution of salary,some will be fixed amount,some will
be based location some will be on grade and etc.
for every company it will be one algorithem that will be implemented
on employe file.
that mean that the employee file will change but still the formulas
after the upoad will be reflected on the population
 
let me give you an example,we have benefit item costs for several of
compencies
every company submitting its own benefit module
i need to upload to excel the module of the cost of every company
some based contribution of salary,some will be fixed amount,some will
be based location some will be on grade and etc.
for every company it will be one algorithem that will be implemented
on employe file.
that mean that the employee file will change but still the formulas
after the upoad will be reflected on the population

Sorry, that doesn't help me a bit.

I have NO idea whether the algorithm can be (or even should be) translated
into SQL code.

My suggestion would be, if the calculations can be done in Excel, is to do
them in Excel, using automation to link the spreadsheet to your database.

John W. Vinson [MVP]
 
Sorry, that doesn't help me a bit.

I have NO idea whether the algorithm can be (or even should be) translated
into SQL code.

My suggestion would be, if the calculations can be done in Excel, is to do
them in Excel, using automation to link the spreadsheet to your database.

             John W. Vinson [MVP]

i have more then 70 spreadsheets and the user need to download the
access to their computer,i cannot put it as a link,is it posible to
centrelize the information to the access
 
i have more then 70 spreadsheets and the user need to download the
access to their computer,i cannot put it as a link,is it posible to
centrelize the information to the access

Yes. You can store the *INFORMATION* - the data upon which the spreadsheets
will operate - in Access, and use Excel to link to that data and do the
calculations locally. I'm not an expert in Excel integration though, so you'll
- again - do better to ask in an Excel newsgroup.

John W. Vinson [MVP]
 
i need anyway to have a query in access that will implement the
formulas from excel,all the question is only if it is posible to
perform some linkape to a formula that is basicly some record string
to be a formula
i found a way to store the formula in a record field that is a memo
type but the only way for me to implement these formulas are to make
them already in the memo field as an update query and just to run a
vba code.
the question is if there is any dlookup that can be used inside ofa
query that will dynamicly change based on the records.
i dont mind to run once while some refresh macro to change the query
but my dezire is to place the formula inside of the query,i know that
there is an option to use DAO that is specializing in stringing
formulas into queries my issue is that my formulas as i told you are
based groups and that way it compexing the way it can be linkage that
formulas
for example
if i have a parameters to a global formula let say 5*x as payroll1 and
6*y as payroll so it is very easy to link it as a SQL string by DAO
but what can be done when 5*x as payroll1 suits only for group1 and
group2 has 1*x and etc,and these formulas might need to be revise in
the future,this make it more complex and for this i need to find a
solution and as i said for now i can only use update query that is
taken from memo field record but i would like it to be more dynamic
 
to cut story short,i prefer to maintain 60 rows of formulas then to
have 60000 row of population and refreshings
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top