Hi,
I am creating a relational database for my A-level ICT coursework (this is the first time I've used database software) and am encountering a bit of trouble when trying to generate a unique ID in the primary key field of one of my forms using a macro.
I wrote a macro that takes the first character of the 'Comments' field, the last three characters of the 'CustomerID' field and the number of days that have elapsed since 01/10/2011 and strings them together to make a unique ID and put it into the primary key field called 'JobID'. The problem is that the macro, which I've set to run 'after update' of the 'Comments' field, doesn't run automatically, but as soon as I click on the JobID field, the macro runs just fine. There's nothing I can see that's telling the macro to run when I click on the field.
The macro details are as follows:
Action
SetValue
Arguments
[Forms]![FrmJob]![JobID], Left([Forms]![FrmJob]![Comments],1) & Right([Forms]![FrmJob]![CustomerID],3) & DateDiff("d",#01/10/2011#,Date())
Any idea how I can fix this? I have other macros that generate unique IDs in other forms that work just fine.
Thanks.