References choice...

  • Thread starter Thread starter strela
  • Start date Start date
S

strela

Hi,

Essential for work in VBA is to choose right references. Is there any good
explanations about references that can be choosen from a list of it?

I have done some programming in VBA, but with bad choice of references, many
commands can't be implemented. As I'm not expert for it, can you help me
with some website, book, etc. that could provide explanations on each
reference (what does it provide,...)? I have seen that choosing one can make
problem if there is already another similiar, so it is very important to
know what to choose. Also, references sequence is important, but I'm not
aware of how to rank them. Thanks in advance.

Best regards,
Stole.
 
hi,
in general - you need to have min 3 references in Access
Access
VBA
DAO (or ADO)

if you are not sure you using any other - you can remove it.

Normally, when developer decides to start using some library or ActiveX
control in access application - he adds reference. it this case he have to
be sure that this library or control installed on other users PCs

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
strela said:
Hi,

Essential for work in VBA is to choose right references. Is there any
good explanations about references that can be choosen from a list of
it?

If you are building apps for deployment onto multiple target systems then the
best practice is to have zero references beyond those that come with Access.
This is especially true if you do not have total control over the configuration
of the target systems.

Any external library functionality your app might need should be done with late
binding so that adding a reference is not necessary.
 
Alex Dybenko said:
hi,
in general - you need to have min 3 references in Access
Access
VBA
DAO (or ADO)

if you are not sure you using any other - you can remove it.

Normally, when developer decides to start using some library or ActiveX
control in access application - he adds reference. it this case he have to
be sure that this library or control installed on other users PCs

This is database for me and few more people. Everyone has the same computer
and software, so this should not be problem. Problem is where can one find
what each reference "brings new" to access VBA? Thanks in advance.

Best regards,
Stole.
 
Problem is that when executing VBA code, it is not recognized for example
that I want to use value from textbox, or combobox value when choice is
made, etc. (I couldn't read these values). So adding few more references
allow this to be done.

One more question: is it possible to define constant 'A' that would pick a
value from combobox and would be visible in whole project (I would use that
value later in other forms,...). One example: when I make query, I would
like to have this value as criteria also after I close form where combobox
choice is made (when query relies on combobox value on form, it looses this
value at the moment the form is closed). Any help?

Thanks in advance.

Best regards,
Stole.
 
Thank you, this is helpful.

I have forgot to ask you too next question:
Is it possible to define constant 'A' that would pick a value from combobox
on a form and would be visible in whole project (I would use that value
later in other forms,...). One example: when I make query, I would like to
have this value as criteria also after I close form where combobox choice is
made (when query relies on combobox value on form, it looses this value at
the moment the form is closed). Any help?

Thanks in advance.

Best regards,
Stole.
 
Hi,
as I understand you - you can declare a public variable in common module, in
combo box AfterUpdate event assign it to selected value. Then you can use it
in code, to use it in a query - you need to make a public function, which
returns this variable value, and use this function in a query

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
I have tried to do that because it seems logical to me, but when I go to
build query in the list of constants,... there is not my value in the list.
How to find it? Or just in the field criteria put her name?

Thanks in advance.

Best regards,
Stole.
 
As Alex said, to use a public Variable elsewhere than in code (e.g. as
data in a Control definition on a Form, or in a Query), you also have
to create a Public Function (in a Module) which returns it. Public
Functions can be called from (virtually) anywhere in an Access
Application; Variables, even Public Variables, can only be used
directly in code.

I have tried to do that because it seems logical to me, but when I go to
build query in the list of constants,... there is not my value in the list.
How to find it? Or just in the field criteria put her name?

Thanks in advance.

Best regards,
Stole.

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
When I take value from one form and assign it to public variable (Zap - it
is taking ID number), and go through code to other just opened form and its
code, Zap looses its value. It becomes 0 from 2 or 3 or 55. Why does this
happen? Is public variable seen through all code or only code of a form
where it is declared and where it gets value?

Is it necessery to declare public variable in all forms or just in one
(first that opens when database is opened)?

Thanks in advance.

Best regards,
Stole.
 
Thank you very much Mr. Dybenko and Mr. Fletcher. The point was, that I have
declared public variable in forms code and it didn't want to keep value in
other forms (public only in that form). When I declared it in module (only
once), it works everywhere.

Best regards,
Stole.
 
You have got it!

Thank you very much Mr. Dybenko and Mr. Fletcher. The point was, that I have
declared public variable in forms code and it didn't want to keep value in
other forms (public only in that form). When I declared it in module (only
once), it works everywhere.

Best regards,
Stole.

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Back
Top