If you are using a continuous form, connected to a table or query, the changes to the amended record will normally be saved automatically as soon as the user leaves it to go to another record.
Normally the only way for a user to change their mind and avoid saving changes to the edited record is to press the <escape> key twice otherwise any changes will be changed automatically.
Do you actually want a user to make changes to multiple records but be allowed to throw away any changes...
Maybe the fields are not Null but simply an Empty, or Zero Length, string?
To cope with Nulls and Zero Length strings you could adapt the code thus..
IIf(Len([IncidentType] & VbNullString) = 0,"N/A",[IncidentType])
But still the Control name needs to be different from the field name to avoid...
A few clues would be useful:
What is the name of the control
What is the Control Source
It doesn't always change the result if the original data is in either the True or False part.
Let's take a look at the above example IIf([IncidentType] Is Null,"N/A",[IncidentType])
If IncidentType is...
The clause 'Not In' is perfectly valid in Access, this should work.
Select * from accounts where beg_date between #1/1/2013# and #12/31/2013# and Val(Nz(acctNo)) In (2,3,4,5,7,12,20) and acct_type Not In ('Individual','User','Viewer')
I'm glad that fixed it.
The control didn't know where the data was coming from, itself (IncidentType) or from the underlying data column (IncidentType). :)
Simply setting the Control Source of the control to =IIf([IncidentType] Is Null,"N/A",[IncidentType]) should work fine, as long as the control isn't (still) called IncidentType as well.
IIf([IncidentType] Is Null,"N/A",[IncidentType])
I bet your ControlName is IncidentType as well?
It's probably a circular reference caused by trying to look at itself, try renaming the control. ;)
Have you changed the Column Count of the ComboBox MainContact to 4 so the values are available?
Have you also checked that there is data available in the records you have chosen.
Private Sub SuffixTxt_AfterUpdate()
ItemNumbertxt = DLookup("item", "dbo_job", ("[suffix] = Forms![**INPUT]![SuffixTxt]") And ("[job] = '" & Forms![**INPUT]![OrderNumbertxt] & "'"))
End Sub
I think you are missing a quote here and there. Would it not be ...
Private Sub SuffixTxt_AfterUpdate()...
An example based on the method of hiding, then closing, the form rather than just closing it.
The example allows for the passing of two values, an Integer (the status) and a Variant (a value).
I have wrapped the functionality into a subroutine in a module which can be reused elsewhere.
Public...
You could pass any values back using TempVar(s) as in the attached example.
I have added some appropriate code to the button form frmStart's command button called cmdClickMe.
Private Sub cmdClickMe_Click()
DoCmd.OpenForm "msgCustom", , , , , acDialog ' Waits here until msgCustom closes...
When opening your form using Docmd.OpenForm you would set the WindowMode to acDialog, this will stop any further execution of the code until the form being opened is closed again.
docmd.OpenForm "yourForm",,,,,acDialog