By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

Trouble saving of record

P: n/a
Hi all,

I've constructed a database that handles data concerning the "flow" of
tooling in a factory. The problem is in receiving back the concerned tools
and storing this data in a table tbl_In. Entry is done via a form that opens
already prefilled with the tool number and a txt field that contains the
current date/time. When clicking the OK button this data should be stored
into the table. However, it doesn't. When I create an extra field in both
the table and the form in which a manual input is done the records saves
flawless. I've put code on the OK button like:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Still, no luck.
Seems that the form needs some human action before storing the data into the
record?
Can someone please point me in the right direction?

Thx, Arend
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Eagle wrote:
Hi all,

I've constructed a database that handles data concerning the "flow" of
tooling in a factory. The problem is in receiving back the concerned tools
and storing this data in a table tbl_In. Entry is done via a form that opens
already prefilled with the tool number and a txt field that contains the
current date/time. When clicking the OK button this data should be stored
into the table. However, it doesn't. When I create an extra field in both
the table and the form in which a manual input is done the records saves
flawless. I've put code on the OK button like:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Still, no luck.
Seems that the form needs some human action before storing the data into the
record?
Can someone please point me in the right direction?


You do need to poke something into somewhere to make the form dirty
otherwise a save will not occur, you could try something like:

txt.Value = txt.DefaultValue ' < this will dirty the form
Me.Dirty = False ' < or your DoCmd if you like typing :)

Actually I like setting Dirty to false but it has one major drawback, it
is not self documenting, to the uninitiated it's not clear if that
command would save or abort the changes.

--
This sig left intentionally blank
Nov 13 '05 #2

P: n/a

"Trevor Best" <no****@besty.org.uk> schreef in bericht
news:41**********************@news.zen.co.uk...
You do need to poke something into somewhere to make the form dirty
otherwise a save will not occur, you could try something like:

txt.Value = txt.DefaultValue ' < this will dirty the form
Me.Dirty = False ' < or your DoCmd if you like typing :)

Actually I like setting Dirty to false but it has one major drawback, it
is not self documenting, to the uninitiated it's not clear if that
command would save or abort the changes.

--
This sig left intentionally blank


Resolved! Thanks Trevor.

Although your workaround didn't completely work the record is saved now.
When I tried your option on the txt field it showed up with "=Now()" in the
saved record because that was set as the default value in the property
window.
It did save however.
Next I placed an unbound (and hidden) textfield txtDate on the form that had
the defaultproperty set to Now().
Upon form load the code Me.Txt = Me.txtDate is executed and......it saves
now.

Thanks again.

Arend
Nov 13 '05 #3

P: n/a
Eagle wrote:
"Trevor Best" <no****@besty.org.uk> schreef in bericht
news:41**********************@news.zen.co.uk...
You do need to poke something into somewhere to make the form dirty
otherwise a save will not occur, you could try something like:

txt.Value = txt.DefaultValue ' < this will dirty the form
Me.Dirty = False ' < or your DoCmd if you like typing :)

Actually I like setting Dirty to false but it has one major drawback, it
is not self documenting, to the uninitiated it's not clear if that
command would save or abort the changes.

--
This sig left intentionally blank

Resolved! Thanks Trevor.

Although your workaround didn't completely work the record is saved now.
When I tried your option on the txt field it showed up with "=Now()" in the
saved record because that was set as the default value in the property
window.
It did save however.
Next I placed an unbound (and hidden) textfield txtDate on the form that had
the defaultproperty set to Now().
Upon form load the code Me.Txt = Me.txtDate is executed and......it saves
now.


Sorry my bad, should have been:

txt.Value = Eval(txt.DefaultValue)

of course you could always use:

txt.Value = Now()

--
This sig left intentionally blank
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.