Unbound fields

neilmcmor

Registered User.
Local time
Today, 05:53
Joined
Aug 9, 2007
Messages
70
I have a form bound to a table that passes several parameters to a query. However there is one field within the form that is unbound that I would also like to pass to the query. I have been unsuccessful in doing it. I have tried to pass it the same way as the others i.e:-
[Forms]![Form name]![Unbound date field]. Has anyone got any idea where I am going wrong.
 
Looks like you have it correct however I notice you are trying to pass a date field so you may need something like the following in the query:

#[Forms]![Form name]![Unbound date field]#
 
Tried that Ken but still not working. Now saying it is an invalid date
 
Hum...

Like #[Forms]![Form name]![Unbound date field]#

And are all of your field values dates? or does some have nulls and/or other data? (like and errantly entered date like 121/07 instead of 1/21/2007?)
 
Did the like fix it? I was going to say you may need to run it through an IsDate() before attempting to use it...

:)
ken
 
No the problem was where I was placing the [Forms]![Form name]![Unbound date field]. I had it in the criteria row as opposed to the field row. Is it possible to have a form button disabled until a condition is true with other field values. I have a button, (appendbtn), that I want disabled until 2 fields, (Day) and (DayCheck) are equal.
 
In the properties box for appendbtn set Enabled to No. Then

Code:
Private Sub Day_AfterUpdate()
 If Me.Day = Me.DayCheck Then
  appendbtn.Enabled = True
 Else
  appendbtn.Enabled = False
 End If
End Sub

Private Sub DayCheck_AfterUpdate()
If Me.Day = Me.DayCheck Then
  appendbtn.Enabled = True
 Else
  appendbtn.Enabled = False
 End If
End Sub

Private Sub Form_Current()
If Me.Day = Me.DayCheck Then
  appendbtn.Enabled = True
 Else
  appendbtn.Enabled = False
 End If
End Sub
 
Its not working unles I switch it to design view and back. Could it be because the DayCheck field is unbound?
 
Fixed

Thanks I got it sorted now. Thanks for your help, very much appreciated
 

Users who are viewing this thread

Back
Top Bottom