ecannelora
Programmer
here's some background:
I've been working on a db for about 15 users. I have a backend on the network and the mde with forms, code, etc on each users machine.
I have 19 linked tables with relationships and a few native tables for temporarily holding data.
At first, all of my forms were bound to queries. If it was an input form, the query would SELECT on PK (a member number) WHERE the PK is null, that way the form doesn't bring back any records, but when data is put into the form it will update the right table.
My display forms were bound to queries that would have joins and whatnot, pulling in all of the info I want to display.
The database ran intolerably slow.
So I decided to try unbinding all of my forms. For input forms, I open a recordset based on the target table and I just add the data from the forms to the table.
For display forms, I open the recordset from wherever and populate the text boxes.
The initial load time of my main display form seems to be about the same as before, but once it's open in a session, I don't close it, I just hide it, and when it receives focus again, I clear all of the text boxes.
Doing this seems to have helped great deal.
Here's my first question: is it generally better to handle record retrieval and editing using recordsets in VBA rather than building queries?
My other question:
in VBA, what's the quickest way to update records? Should I use DoCmd.RunSQL, or should I open a record set and edit as needed?
I've been working on a db for about 15 users. I have a backend on the network and the mde with forms, code, etc on each users machine.
I have 19 linked tables with relationships and a few native tables for temporarily holding data.
At first, all of my forms were bound to queries. If it was an input form, the query would SELECT on PK (a member number) WHERE the PK is null, that way the form doesn't bring back any records, but when data is put into the form it will update the right table.
My display forms were bound to queries that would have joins and whatnot, pulling in all of the info I want to display.
The database ran intolerably slow.
So I decided to try unbinding all of my forms. For input forms, I open a recordset based on the target table and I just add the data from the forms to the table.
For display forms, I open the recordset from wherever and populate the text boxes.
The initial load time of my main display form seems to be about the same as before, but once it's open in a session, I don't close it, I just hide it, and when it receives focus again, I clear all of the text boxes.
Doing this seems to have helped great deal.
Here's my first question: is it generally better to handle record retrieval and editing using recordsets in VBA rather than building queries?
My other question:
in VBA, what's the quickest way to update records? Should I use DoCmd.RunSQL, or should I open a record set and edit as needed?