Documentation for Macros

  • Thread starter Thread starter SQL Brad
  • Start date Start date
S

SQL Brad

I am new to Macros for Access, is there a good book someone can recommend
that is not too techy.....if it involves VBA forget it.....but thanks in
advance for recommendations.....

I am trying to build a small menu for some non-computer literate desk clerks
to enter demographic data into access and have it print some reports, etc.

thanks
 
SQL Brad,

If you are using Access 2007, then "Access 2007 Inside Out" by Viescas
and Conrad has a good section on macros.

I find Access's Help on macros to be very useful.
 
I am in a similar position, but MS help and Viescab don't help. My basic
problem is to use a split form to get user input to display the results of
filters on number and date fields. I've done it for text fields but keep
getting errors these. I think I am getting the macro filter condition syntax
wrong. I need either specific advice or a reference to a really basic macro
book, please.
 
Bidders,

Would be happy to try and provide specific advice, if you can provide
specific details and examples.
 
Many thanks.
The Access database is flat and has 13 fields including Surname(text),
Age(Number) and date of birth DOB(date). The aim is to have a menu driven
interface for non computer literate users to input field data to obtain
filtered outputs. I am using split forms to do this. The form includes a text
box for user input, a command button and selected fields to display
individual records from the filtered database; the bottom half of the form
displays all records from the filtered database

Text Filter(Successful)

Form-Get Surname
User input
Text Box. Properties: Caption-Type in Surname. Unbound box -Properties: Name
- txtSurname.
Command Button - Properties: Name - cmdFindSurname, Caption - Click to Find
Electors, On Click - msurname.
Macro - msurname. Action- ApplyFilter. Arguments - Where Condition -
="Surname='" & [Forms]![Get Surname]![txtSurname] & "'"

Date Filter - Unsuccessful

Form Get DOB
User Input
Text Box. Properties: Caption- Type in Date of Birth (Format **/**/****).
Unbound box, Properties:Name - txtDOB
Command Button. Properties: Name - cmdFindDOB, Caption - Click to Find
Electors, On Click - mDOB.
Macro - mDOB. Action- ApplyFilter. Arguments - Where Condition - ="DOB='" &
[Forms]![Get DOB]![txtDOB] & "'"

This fails with an error message "incompatible field data" or something very
like it.
Is my attempt to use a text box to get date field input from the user
unsound? Or is the macro argument syntax incorrect. I've spent hours trying
variations with no success; the most unpromising result being an unfiltered
output.

My results of using a similar approach to filter on a number field have also
been unsuccessful.

Can you point me in the right direction please?

Many thanks in anticipation.
 
Bidders,

Thanks for your clear explanation.

The '' delimiters are applicable to text data. With dates, you need #
delimiters instead. So, Where Condition:
="[DOB]=#" & [Forms]![Get DOB]![txtDOB] & "#"

For numbers, there are nio delimiters:
="[YourNumber]=" & [Forms]![Get Number]![txtNumber]
 
Many, many thanks Steve.

One further favour, please. It would help me and probably others if you
could indicate where we can find such information. It is not mentioned
explicitly in Viescas, for example, and it didn't help that I had no idea
what to look for!!
--
Bidders


Steve Schapel said:
Bidders,

Thanks for your clear explanation.

The '' delimiters are applicable to text data. With dates, you need #
delimiters instead. So, Where Condition:
="[DOB]=#" & [Forms]![Get DOB]![txtDOB] & "#"

For numbers, there are nio delimiters:
="[YourNumber]=" & [Forms]![Get Number]![txtNumber]

--
Steve Schapel, Microsoft Access MVP

Many thanks.
The Access database is flat and has 13 fields including Surname(text),
Age(Number) and date of birth DOB(date). The aim is to have a menu driven
interface for non computer literate users to input field data to obtain
filtered outputs. I am using split forms to do this. The form includes a text
box for user input, a command button and selected fields to display
individual records from the filtered database; the bottom half of the form
displays all records from the filtered database

Text Filter(Successful)

Form-Get Surname
User input
Text Box. Properties: Caption-Type in Surname. Unbound box -Properties: Name
- txtSurname.
Command Button - Properties: Name - cmdFindSurname, Caption - Click to Find
Electors, On Click - msurname.
Macro - msurname. Action- ApplyFilter. Arguments - Where Condition -
="Surname='" & [Forms]![Get Surname]![txtSurname] & "'"

Date Filter - Unsuccessful

Form Get DOB
User Input
Text Box. Properties: Caption- Type in Date of Birth (Format **/**/****).
Unbound box, Properties:Name - txtDOB
Command Button. Properties: Name - cmdFindDOB, Caption - Click to Find
Electors, On Click - mDOB.
Macro - mDOB. Action- ApplyFilter. Arguments - Where Condition - ="DOB='" &
[Forms]![Get DOB]![txtDOB] & "'"

This fails with an error message "incompatible field data" or something very
like it.
Is my attempt to use a text box to get date field input from the user
unsound? Or is the macro argument syntax incorrect. I've spent hours trying
variations with no success; the most unpromising result being an unfiltered
output.

My results of using a similar approach to filter on a number field have also
been unsuccessful.

Can you point me in the right direction please?

Many thanks in anticipation.
 
Back
Top