Data on a Form problem - pls help

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

I have a data entry form which is used to enter data,
i.e. recipts on payment sthatwe have recived during the
day or last days. I would like to have a data received or
posted field on my form to keep the first data entered
and stay the same for the next record or records until I
change it but the changed one also stays for next x
records to be added and so on. i posted this question
before and i got a suggestion that keeps the very first
date entered as the default and stays there, provided all
my recipts to be entered having the same date this will
work but once I start entering recipts for a different
data, I again have to change data maually.

Is there any way to accomplished this task?

Thanks in advance for you help.

Regards,

Mike
 
Mike, I don't have Access here to check, but from memory, >unbound< fields
are retained (not erased or reset) when each new record is saved. If that is
true, just do this. Say the name of the relevant date field is DateReceived,
and the textbox is txtDateRecived.

- Leave the textbox unbound, that is, do not put anything in its
Controlsource property;
- put this in form_beforeupdate, to manually copy the entered value into the
field:
Me![DateReceived] = me![txtDateRecived]

If unbound fields >are< erased when a new record is saved, forget that I
suggested this!

HTH,
TC
 
Oops: also put that line in form_beforeinsert.

TC


TC said:
Mike, I don't have Access here to check, but from memory, >unbound< fields
are retained (not erased or reset) when each new record is saved. If that is
true, just do this. Say the name of the relevant date field is DateReceived,
and the textbox is txtDateRecived.

- Leave the textbox unbound, that is, do not put anything in its
Controlsource property;
- put this in form_beforeupdate, to manually copy the entered value into the
field:
Me![DateReceived] = me![txtDateRecived]

If unbound fields >are< erased when a new record is saved, forget that I
suggested this!

HTH,
TC


Mike said:
Hi,

I have a data entry form which is used to enter data,
i.e. recipts on payment sthatwe have recived during the
day or last days. I would like to have a data received or
posted field on my form to keep the first data entered
and stay the same for the next record or records until I
change it but the changed one also stays for next x
records to be added and so on. i posted this question
before and i got a suggestion that keeps the very first
date entered as the default and stays there, provided all
my recipts to be entered having the same date this will
work but once I start entering recipts for a different
data, I again have to change data maually.

Is there any way to accomplished this task?

Thanks in advance for you help.

Regards,

Mike
 
GAK! Brain fart. Do *not* put that line in form_beforeinsert. Having it just
in form_beforeupdate, will work fine.

TC


TC said:
Oops: also put that line in form_beforeinsert.

TC


TC said:
Mike, I don't have Access here to check, but from memory, >unbound< fields
are retained (not erased or reset) when each new record is saved. If
that
is
true, just do this. Say the name of the relevant date field is DateReceived,
and the textbox is txtDateRecived.

- Leave the textbox unbound, that is, do not put anything in its
Controlsource property;
- put this in form_beforeupdate, to manually copy the entered value into the
field:
Me![DateReceived] = me![txtDateRecived]

If unbound fields >are< erased when a new record is saved, forget that I
suggested this!

HTH,
TC


Mike said:
Hi,

I have a data entry form which is used to enter data,
i.e. recipts on payment sthatwe have recived during the
day or last days. I would like to have a data received or
posted field on my form to keep the first data entered
and stay the same for the next record or records until I
change it but the changed one also stays for next x
records to be added and so on. i posted this question
before and i got a suggestion that keeps the very first
date entered as the default and stays there, provided all
my recipts to be entered having the same date this will
work but once I start entering recipts for a different
data, I again have to change data maually.

Is there any way to accomplished this task?

Thanks in advance for you help.

Regards,

Mike
 
Thanks TC, but one question, if nothing in the control
source then how do I save data in the table to which the
form is blounded to?

All I want to do is to be able to retain an entered date
for a numbers on future record entry, it may need to stay
for the next record only or for the next 10 records to be
added and then changed again manually and does the same
thing.

Is this possible?

Regards,

Mike
-----Original Message-----
Oops: also put that line in form_beforeinsert.

TC


TC said:
Mike, I don't have Access here to check, but from memory, >unbound< fields
are retained (not erased or reset) when each new
record is saved. If that
is
true, just do this. Say the name of the relevant date
field is
DateReceived,
and the textbox is txtDateRecived.

- Leave the textbox unbound, that is, do not put anything in its
Controlsource property;
- put this in form_beforeupdate, to manually copy the
entered value into
the
field:
Me![DateReceived] = me![txtDateRecived]

If unbound fields >are< erased when a new record is saved, forget that I
suggested this!

HTH,
TC


Mike said:
Hi,

I have a data entry form which is used to enter data,
i.e. recipts on payment sthatwe have recived during the
day or last days. I would like to have a data received or
posted field on my form to keep the first data entered
and stay the same for the next record or records until I
change it but the changed one also stays for next x
records to be added and so on. i posted this question
before and i got a suggestion that keeps the very first
date entered as the default and stays there, provided all
my recipts to be entered having the same date this will
work but once I start entering recipts for a different
data, I again have to change data maually.

Is there any way to accomplished this task?

Thanks in advance for you help.

Regards,

Mike


.
 
Hi Mike. I was referring to the controlsource of the textbox where you enter
the date. That >one control< should be unbound. The form itself, should be
bound to the table in the normal way. (That is, you can have unbound
controls, on a bound form.) The line of code that I suggested for
form_beforeupdate, basically says: "Oops, let's save (in the table) the
value of that unbound control (as well automatically saving the bound
controls)".

Hope that helps. I'm off now, so I won't see your reply (if any) for another
24 hours.

Cheers,
TC


Mike said:
Thanks TC, but one question, if nothing in the control
source then how do I save data in the table to which the
form is blounded to?

All I want to do is to be able to retain an entered date
for a numbers on future record entry, it may need to stay
for the next record only or for the next 10 records to be
added and then changed again manually and does the same
thing.

Is this possible?

Regards,

Mike
-----Original Message-----
Oops: also put that line in form_beforeinsert.

TC


TC said:
Mike, I don't have Access here to check, but from memory, >unbound< fields
are retained (not erased or reset) when each new
record is saved. If that
is
true, just do this. Say the name of the relevant date
field is
DateReceived,
and the textbox is txtDateRecived.

- Leave the textbox unbound, that is, do not put anything in its
Controlsource property;
- put this in form_beforeupdate, to manually copy the
entered value into
the
field:
Me![DateReceived] = me![txtDateRecived]

If unbound fields >are< erased when a new record is saved, forget that I
suggested this!

HTH,
TC


Hi,

I have a data entry form which is used to enter data,
i.e. recipts on payment sthatwe have recived during the
day or last days. I would like to have a data received or
posted field on my form to keep the first data entered
and stay the same for the next record or records until I
change it but the changed one also stays for next x
records to be added and so on. i posted this question
before and i got a suggestion that keeps the very first
date entered as the default and stays there, provided all
my recipts to be entered having the same date this will
work but once I start entering recipts for a different
data, I again have to change data maually.

Is there any way to accomplished this task?

Thanks in advance for you help.

Regards,

Mike


.
 
Private Sub Form_AfterUpdate()
Me.PostedOn.DefaultValue = CStr(Me.PostedOn.Value)
Me.ReceivedOn.DefaultValue = CStr(Me.ReceivedOn.Value)
End Sub
 
yes TC, you're right, i guessed their names for Mike'sproject, not knowing
what you named them

but of course they should really be named with prefixes according to some
convention like


Private Sub Form_AfterUpdate()
Me.datPostedOn.DefaultValue = CStr(Me.datPostedOn.Value)
Me.datReceivedOn.DefaultValue = CStr(Me.datReceivedOn.Value)
End Sub
 
Back
Top