It isn't that you need to trust files. What the Trusted Documents thing is all about is that they assume that if you have it in a Trusted Location, then it is Trusted. If you don't have it in a Trusted Location and you click ENABLE they assume that it is trusted so, that will become a Trusted...
One more thing -
you can make this more generic:
DoCmd.Close acForm, "frm1", acSaveNo
By using
DoCmd.Close acForm, Me.Name, acSaveNo
if that code is on the form that is needing to be closed, you don't need to type the name. Just use Me.Name.
That meant that the database was not trusted nor in a trusted location. I hope you know what Trusted Location means in 2010. If not, here's a link:
http://www.btabdevelopment.com/ts/2010TL
By enabling, you had set this as a trusted document (that is new in 2010, Access 2007 only had trusted...
I think we need to have you upload a copy of the database to keep from having to write a book. Also, it sounds like you have used lookups directly on fields at table level and, for most new users, that is not a wise thing to do.
Read this to see why:
http://www.mvps.org/access/lookupfields.htm
First off, we need to get it to work in the Before Update event because that's where it goes. It isn't a matter of "thanks for trying." If you can't get it to work then something is not right and we need to fix it.
So, when you say it doesn't work, what actually does that mean? Have you set...
Rewritten with the Access Reserved words changed to something else would be:
If Len(Me.txtDay & vbNullString) > 0 And Len(Me.txtTime & vbNullString) = 0 Then
If MsgBox("Please make a selection for Time", vbOKCancel, "Time Selection Not Complete!") = vbOK Then
Cancel =...
You didn't post the entire event so we don't know which one you have used. But it is the Before Update event you should be using and then you don't use DoCmd.CancelEvent but you use
Cancel = True
Also, a couple of other things. Your field names are using Access Reserved Words (Day, Time)...
So can you outline the exact steps you have tried to do?
So did you actually build a form with a combo box on it from which you would be selecting the parameter value for the query?
How about you upload your database here with fake data so then we can put it in place and you can see how it is...
Well, it does look like it does translate that to an empty string. Two single quotes work, two double quotes work as long as there is something else in the control even if it is just a space.
Your problem looks to be this in the SQL of the query:
PARAMETERS [Forms]![ZooMobile Event Booking].[ClientIDTxt] Text ( 255 );
remove the Parameter from the query parameters dialog or just delete that line from the SQL View of the query.
What I guess I was thinking is that it should be fine. But I just tested and it does appear that it thinks you are entering an "Empty String." So it just shows as blank. So, it is interpreting it as an empty string which, in VBA is "" so again I will ask, "Why would someone type that in there?"
In this case it wouldn't matter so much. But if you were using a BETWEEN statement, it can make a huge difference due to the comparison of the times included.
1. I only let users interact with forms so I have a Before Update event.
2. I validate in that Before Update event so I can easily cancel things and give my own message.
If you are using validation rules in tables, you can put your own custom message in the Validation Text property.
They should be able to if the field the text box is bound to is a TEXT or Memo datatype. Nothing special needed there. What is it to designate? Why would they be putting that in there?