Refering to [field] on a form?

  • Thread starter Thread starter JethroUK©
  • Start date Start date
J

JethroUK©

How do i refer to a field on a form?

the field [last updated] is included in the forms record source - but it's
not bound to any controls - i thought square brackets was the proper method:

Private Sub Form_BeforeUpdate(Cancel As Integer)
[last updated] = Now()
dedaa
dedaa
dedaa


but it doesn't seem to work ?
 
that worked thanks - strange thing is - the event stopped firing at all (it
'was' because i checked it) - i've had this happen before, i think it's a
bug - and as i did previously, i cut the contents - deleted the whole
event - recreated it - pasted the code back in and it started firing again

whether there was a connection with the event containing a bad syntax & it
somehow killed it i dont know



Allen Browne said:
Try:
Me![last updated] = Now()

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

JethroUK) said:
How do i refer to a field on a form?

the field [last updated] is included in the forms record source - but
it's
not bound to any controls - i thought square brackets was the proper
method:

Private Sub Form_BeforeUpdate(Cancel As Integer)
[last updated] = Now()
dedaa
dedaa
dedaa


but it doesn't seem to work ?
 
Sometimes the property loses its [Event Procedure] setting, and so the event
procedure does not execute.

If that is not the case it's time for a decompile.
Compact first. Then decompile. Then Compact again.

To decompile, enter something like this at the command prompt while Access
is not running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

JethroUK) said:
that worked thanks - strange thing is - the event stopped firing at all
(it
'was' because i checked it) - i've had this happen before, i think it's a
bug - and as i did previously, i cut the contents - deleted the whole
event - recreated it - pasted the code back in and it started firing again

whether there was a connection with the event containing a bad syntax & it
somehow killed it i dont know

Allen Browne said:
Try:
Me![last updated] = Now()

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

JethroUK) said:
How do i refer to a field on a form?

the field [last updated] is included in the forms record source - but
it's
not bound to any controls - i thought square brackets was the proper
method:

Private Sub Form_BeforeUpdate(Cancel As Integer)
[last updated] = Now()
dedaa
dedaa
dedaa


but it doesn't seem to work ?
 
Back
Top