R
Ruth Isaacs
Hello All
I have a form where, after the user enters a new record, I need the value of
one of the fields (called [websiteID] in that new record to be assigned
using the value one of the other fields (called [postcode] - the user will
have typed this in).
I origially had the following AfterInsert event for the form:
[websiteID].Value = FindAndReplace([postcode], " ", "") & "1"
.... but this did nothing. I tried having a button with the above OnClick
event, and that worked perfectly OK.
I then thought the problem must be that the value of [postcode] had not been
saved to the database at the time the AfterInsert event was firing, so I
amended the AfterInsert event to:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
[websiteID].Value = FindAndReplace([postcode], " ", "") & "1"
.... but now I get a message that the refresh command isn't available now!
So my question is: why is this - and how can I get round it?
Thanks for any help.
Les
I have a form where, after the user enters a new record, I need the value of
one of the fields (called [websiteID] in that new record to be assigned
using the value one of the other fields (called [postcode] - the user will
have typed this in).
I origially had the following AfterInsert event for the form:
[websiteID].Value = FindAndReplace([postcode], " ", "") & "1"
.... but this did nothing. I tried having a button with the above OnClick
event, and that worked perfectly OK.
I then thought the problem must be that the value of [postcode] had not been
saved to the database at the time the AfterInsert event was firing, so I
amended the AfterInsert event to:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
[websiteID].Value = FindAndReplace([postcode], " ", "") & "1"
.... but now I get a message that the refresh command isn't available now!
So my question is: why is this - and how can I get round it?
Thanks for any help.
Les