Record set types & how forms update tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to figure out a problem with a form. I have a form with a button that runs a string of queries (mostly append queries) using a macro. These queries all have criteria set on four fields (listed below).

Feild name data type Criteri
confirmed yes/no Ye
Conrimed By Text Is Not Nul
Order # Number Is Not Nul
Amount billed Number Is Not Nul

When I enter the information in these four fields on the form then click the button to run the macro, none of the append queries will run. The marning message comes up with with 0 records being appended. If I view another record and return and click the button all the records append properly. I am assuming this has something to do with the table not being updated with the required data. I have tried using both "Dynaset" and "Dynaset (inconsistant update)" record types same result

Any help would be greatly appreciated
BDP
 
I am trying to figure out a problem with a form. I have a form with a button that runs a string of queries (mostly append queries) using a macro. These queries all have criteria set on four fields (listed below).

Feild name data type Criteria
confirmed yes/no Yes
Conrimed By Text Is Not Null
Order # Number Is Not Null
Amount billed Number Is Not Null

When I enter the information in these four fields on the form then click the button to run the macro, none of the append queries will run. The marning message comes up with with 0 records being appended. If I view another record and return and click the button all the records append properly. I am assuming this has something to do with the table not being updated with the required data. I have tried using both "Dynaset" and "Dynaset (inconsistant update)" record types same result.

Any help would be greatly appreciated.
BDP

Please post the SQL of your query. If you're trying to append data
*from a Form*, you're on the wrong track - append queries copy data
from table to table, not from form to table. Another possibility is
that you have some Lookup fields in the table that you're appending
from... they won't contain what they appear to contain.
 
I have the exact same situation (but my macro code is
different) and what I've found is that regardless of what
the macro code is doing, the last row edited in the form
is not being updated when you click right onto the
button. You have to click into another row first for the
update of the last row to occur.

What I'm trying to do is trigger the update of that last
row at the beginning of my macro code. I've tried:
DoCmd.Save acForm, "My form"

but that just gives me 'Access can't complete this
operation' errors.

Does anyone know a better way to do this?
-----Original Message-----
a form with a button that runs a string of queries (mostly
append queries) using a macro. These queries all have
criteria set on four fields (listed below).form then click the button to run the macro, none of the
append queries will run. The marning message comes up with
with 0 records being appended. If I view another record
and return and click the button all the records append
properly. I am assuming this has something to do with the
table not being updated with the required data. I have
tried using both "Dynaset" and "Dynaset (inconsistant
update)" record types same result.
 
What I'm trying to do is trigger the update of that last
row at the beginning of my macro code. I've tried:
DoCmd.Save acForm, "My form"

but that just gives me 'Access can't complete this
operation' errors.

Does anyone know a better way to do this?

The DoCmd.Save action does NOT save the edited record; it saves design
changes to the structure of the form.

Try DoCmd.RunCommand acCmdSaveRecord instead.
 
Thank you - that worked perfectly. It leads me to a
similar question...how can I do that for multiple forms
that may be open at the time they click this button?

Is there way I can run the same command but specifying to
save the current record on the other open forms?
 
Is there way I can run the same command but specifying to
save the current record on the other open forms?

You'll have to SetFocus to each of the other forms in turn before
issuing the DoCmd acCmdSaveRecord. This may get a bit tricky, as
you'll need a list of the possible forms and you'll also need to
determine which are open!
 
Back
Top