FoxProProgrammer
Programmer
I am trying to do something that should be simple. The more Access Help screens that I read, the more confused I get! lol
Let's say that a database contains several tables and several forms. One of the forms has only unbound list boxes, combo boxes, and a few buttons. I set the RowSource for each combo box and list box in an event procedure. For example, when the user selects an item from a combo box, the On Click procedure sets the RowSource for the other controls based on the selection. That all works great. The form does not have a RecordSource, nor do I think it needs one to accomplish the purpose of the form.
Now for the problem...The user presses a button when they want to change the data in a record. The record that I need to find in the table is reflected by their selections in the unbound controls. In FoxPro, I would simply select the table to look in with a SELECT statement (not SQL select), SEEK or LOCATE the record and REPLACE the data in a field. I looked in the Access Help for something similar and found multiple Find methods, multiple ways to update records, etc. I tried RecordSetClone.FindFirst but get an error. Perhaps I am getting this error because the form doesn't have a RecordSource? I don't understand the difference between ADO and DAO, and maybe that's why I am having trouble figuring out how to do what should be easy tasks in Access. Do I have to define my application as DAO or ADO or can I use either types of syntax in the same application? That might sound like a dumb question, but I am new to Access.
In summary:
- I need to select a table in a database.
- Find a record.
- Check to see if the record was found.
- If found, change the value in one of the fields in that record.
Any help would be greatly appreciated.
Thanks!
dz
Let's say that a database contains several tables and several forms. One of the forms has only unbound list boxes, combo boxes, and a few buttons. I set the RowSource for each combo box and list box in an event procedure. For example, when the user selects an item from a combo box, the On Click procedure sets the RowSource for the other controls based on the selection. That all works great. The form does not have a RecordSource, nor do I think it needs one to accomplish the purpose of the form.
Now for the problem...The user presses a button when they want to change the data in a record. The record that I need to find in the table is reflected by their selections in the unbound controls. In FoxPro, I would simply select the table to look in with a SELECT statement (not SQL select), SEEK or LOCATE the record and REPLACE the data in a field. I looked in the Access Help for something similar and found multiple Find methods, multiple ways to update records, etc. I tried RecordSetClone.FindFirst but get an error. Perhaps I am getting this error because the form doesn't have a RecordSource? I don't understand the difference between ADO and DAO, and maybe that's why I am having trouble figuring out how to do what should be easy tasks in Access. Do I have to define my application as DAO or ADO or can I use either types of syntax in the same application? That might sound like a dumb question, but I am new to Access.
In summary:
- I need to select a table in a database.
- Find a record.
- Check to see if the record was found.
- If found, change the value in one of the fields in that record.
Any help would be greatly appreciated.
Thanks!
dz