Invald or Primary Key Cannot contain a null value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone tell me why I might be getting this message when I add the
following code in the AfterUpdate event of one of my 3 primary key fields in
my table called NewParts, which has a left join to the below table
ExcelBRefParts in my query, which is the data source for my form. When I
click Close, I get the message, but all three primary key fields are
complete. Any ideas? Thanks much.

Me.Act_New_Part_Var_Cost = DLookup("[Variable]", "ExcelBRefParts", "[PART#]
= [New Part#] And [AS PART#] = [New Part NHL] And [Model#] = [Model]")
 
If you have it working for dates, the only difference is to get your code to
see only the time portion of the control's value. Try using the TimeValue()
function.

Barry
 
Dates? There are no date fields in my form.

Barry Gilbert said:
If you have it working for dates, the only difference is to get your code to
see only the time portion of the control's value. Try using the TimeValue()
function.

Barry

Alex said:
Can anyone tell me why I might be getting this message when I add the
following code in the AfterUpdate event of one of my 3 primary key fields in
my table called NewParts, which has a left join to the below table
ExcelBRefParts in my query, which is the data source for my form. When I
click Close, I get the message, but all three primary key fields are
complete. Any ideas? Thanks much.

Me.Act_New_Part_Var_Cost = DLookup("[Variable]", "ExcelBRefParts", "[PART#]
= [New Part#] And [AS PART#] = [New Part NHL] And [Model#] = [Model]")
 
Sorry. Somehow my response to another posting made it to this one.
Multi-tasking seems to be my downfall today.

Barry


Alex said:
Dates? There are no date fields in my form.

Barry Gilbert said:
If you have it working for dates, the only difference is to get your code to
see only the time portion of the control's value. Try using the TimeValue()
function.

Barry

Alex said:
Can anyone tell me why I might be getting this message when I add the
following code in the AfterUpdate event of one of my 3 primary key fields in
my table called NewParts, which has a left join to the below table
ExcelBRefParts in my query, which is the data source for my form. When I
click Close, I get the message, but all three primary key fields are
complete. Any ideas? Thanks much.

Me.Act_New_Part_Var_Cost = DLookup("[Variable]", "ExcelBRefParts", "[PART#]
= [New Part#] And [AS PART#] = [New Part NHL] And [Model#] = [Model]")
 
Back
Top