advanced access training - forms
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access Training and help » advanced access training - Forms

advanced access training - Forms

resolvedResolved · Low Priority · Version Standard

replyReply Thu 20 Sep 2007, 11:19Delegate Richard said...

Richard has attended:
Access Advanced course

Forms

I have a form that displays address fields from a table. I am displaying two sets of addresses that have been cleaned. So there is the before and after address on the screen.

I want to have a button on the form that if pressed will enter the word Yes in a specific field. The field that is to be used is a new field and does not have any data in it.

How do I create this button?

Thanks

For upcoming training course dates see: Pricing & availability

replyReply Fri 21 Sep 2007, 15:24 Edited on Fri 21 Sep 2007, 15:25Trainer Richard said...

RE: Forms

Good question.

First Create a Macro

- Use the SetValue command.
- In ITEM , specify the name of the field you want to set
- In EXPRESSION, enter "Yes" (including inverted commas)

Save and then give the macro a name.


Now go to the form in Design view

- Add a command button using the Toolbox
- Cancel the Wizard that starts when you draw the box
- Go to to the properties of the command box
- Select the EVENT tab, and then choose the ONCLICK box
- Drop down the arrow, and select the name of the MARCO you just recorded.

SAVE

TEST the system.


Let me know how you do.

Regards

Richard









replyReply Mon 24 Sep 2007, 11:22Delegate Richard said...

RE: Forms

Thanks for email. I have created the command button as you instructed.

When I test the button the following error messages appear. I'm not sure what they mean.

The object doesn't contain the Automation object '3b - For Review UK.' (Note: 3b - For Review Uk is the table name)

You tried to run a Visual Basic procedure to set a property or method for an object. However, the component doesn't make the property or method available for Automation operations.

Check the component's documentation for information on the properties and methods it makes available for Automation operations.

(Note: When you press OK to this message, the following message appears:)

Action Failed
Macro Name: Update record with Yes
Condition: True
Action Name: SetValue
Arguments: [3b - For Review UK]![Update], "Yes"

(Note: There are three buttons on this screen but only one is usable, the other two are grayed out. The usuable button is called Halt, the two grayed out buttons are called Step and Continue.

Any ideas how I can fix this problem. I have also created a second command button in the same way that updates the same field with the value "No". The same two error messages appear, except the second error message has the macro name and argument of:
Macro Name: Update record with No
Arguments: [3b - For Review UK]![Update], "No"

Many Thanks

replyReply Tue 25 Sep 2007, 13:27Delegate Richard said...

RE: Forms

Hi Richard,

Just to let you know that I have fixed the error that I was getting. The reason I was getting an error was that in the item line on the macro I chose the field that is to be updated by drilling down in the tables and finding the field.

I changed this by adding the field that is to be updated into the form but made that field invisable so that it does not appear on the form.

I then went back to the macro and in the item line, I drilled down in the forms, and found the newly added field.

This now adds the value Yes to the field.
I have also added another command button that adds the value No when pressed.

Thank you for your help. Much appreciated.

Richard

replyReply Fri 28 Sep 2007, 10:45Trainer Richard said...

RE: Forms

A pleasure, glad you got it working

 

Access tip:

Change The Default Font in Access 2003

You can change the default font in Access 2003 so that whenever you create a new database your preferred font is automatically set.

To change the default font:

1.From the menu bar select Tools.
2.Click Options.
3.Go to the Datasheet tab:
4.In the Default font section select your preferred font from the list of fonts e.g. Arial.
5.Select your preferred size from the size menu e.g. 12.
6.Click Apply.

Click on the Tables/queries tab:
1.In the Query Design font section select your preferred font from the list of fonts e.g. Arial.
2.Select your preferred size from the size menu e.g. 12.
3.Click Apply.
4.Click OK.

The default font for Access has now been changed.

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard