PDA

View Full Version : I am designing an Access database form. How can I get my next control in the form to



wedd
01-09-2012, 09:56 AM
I am designing an Access database form. How can I get my next control in the form to be automatically selected? At the moment when I add a new record it stores the data from a previous record and I'm unable to add new data and save it to create a new entry of new data...


Thanks for your contributions:friends:

HiTechCoach
01-10-2012, 08:21 AM
Sounds like the control is not bound. Check the control's property for Control Source.

wedd
01-12-2012, 05:31 AM
Hi, HiTechCoach! Thanks! It works! I haven't tested it with any data yet...however when I enter a customerID number in the find text box it takes the user to that record.

HiTechCoach
01-12-2012, 11:35 PM
Thanks for the update. Glad that is working for you.

wedd
01-13-2012, 07:37 AM
Hi, HiTechCoach! Is it possible to search for a customer's record by instead of using a customerID number enter their first name and surname using vba code? Thanks for the ideas..

HiTechCoach
01-13-2012, 12:09 PM
Hi, HiTechCoach! Is it possible to search for a customer's record by instead of using a customerID number enter their first name and surname using vba code? Thanks for the ideas..

By VBA do you mean:

1) run aquery

2) open a record based on a query


Searching is really done with SQL/Queries. Using forms and queries, It can be done with only one line of VBA code using ObjectName.Requery.

The key to searching is learning to write SQL statements. You can use VBA code to dynamically build the SQL to do create more powerful searches. But that is not usually needed.

See:
Overview of Access Queries (http://www.hitechcoach.com/index.php?option=com_docman&task=doc_details&gid=37&Itemid=28)

Search criteria (http://www.hitechcoach.com/index.php?option=com_weblinks&view=weblink&id=436:search-criteria&catid=80:access-forms-tips-and-tricks&Itemid=20)