hooglmango.blogg.se

Typesy error2046
Typesy error2046





typesy error2046

typesy error2046

It should suffice to check this field before leaving the form or before adding a new record. This way you always assign a new number (the next highest) to unpopulated Med Number fields in new records. NewNumber=(DMax("","Concomitant Medications")+1) In fact, you should not try to assign "0" to the mednumber, since it is a primary key and must not contain duplicates either. You are right, there is a difference between "", NULL and 0. In a worst case, is there some way to disable the 'Debug' button on the message box with 3314 on it, and therefore let the user just continue? I've tried to program 'around' what i believe to be the situation, but (being a newbie) i'm not sure it's still not missing the mark. It seems as if there's something like a 'catch-22' operating here: the 'Med Number' cannot be Null so you can't test for when the record for a given 'Patient Number' has not been entered previously yet in order to begin the process of enumerating 'Med Number's it has to be. In essence, i'm trying to facilitate the user's experience when entering a new record - automating the task of populating the 'Med Number' field with an identifying number that is incrementally larger than the one before. = 1 + DMax("", "Concomitant Medications", " = " & Me!) RetValue = MsgBox("Delete any records exceeding the upper limit", vbInformation)

#TYPESY ERROR2046 CODE#

The code i'm running is just below this line: There is a composite primary index on the underlying table comprised of 'Patient Number' and 'Med Number'. There are 4 buttons on this message box, a) Continue, b) End, c) Debug, d) Help. "The field 'Concomitant Medications.Med Number' cannot contain a Null value because the Required property for this field is set to True. When i run my vba code, a2k displays a message from visual basic with the above verbiage.







Typesy error2046