Hi all,
I have a combo (CboCompanyType) that selects the "Company Type" from a query. I also have a check box on that called "Primary" in that query.
I am having problems coming up with a code as to when i select a "CompanyType" from the dropdown, i want it to see if it all ready has a primary type
in the query where "CompanyID=" CompanyID
If it does, then msgbox "Primary all ready exist, would you like to replace?"
If yes, then remove the record that all ready set to primary and make this record primary.
If no, then cancel
If it doesnt have a Primary value yet in the query then
Call Primary Click
Something to this efect, not even sure how to say this clearly?
Basically looking to make a check box for a Primary but only allow one per CompanyID if
this make sense?
Primary_OnClick()
If Primary = 0 then
MsgBox "Would you like to set as Primary?"
'If Yes then set value to check box = -1
'If No then cancel=True
CboCompanyType_AfterUpDate()
'Check to see if table/Query all ready has a primary where "CompanyID=" CompanyID
If Primary = -1, then
MsgBox "Primary all ready exist for this company! Would you like to replace?"
'Yes then set Primary Value to = 0 for the one that is all ready checked
'and set primary value for this record to =-1
'If no, then cancel = true
Thanks
Dave