I have a form based on a query of appointments. I want to be able to have
the user enter the appointment number (I've used a combo box to allow this),
and have the arrival date and arrive time (two separate fields, I know, not
cool, but I inheireted it this way) automatically populate.
I can't believe I'm having such difficulties with this.
BTW---Access 97
Al Campagna - 06 May 2007 15:02 GMT
Boz,
Where are the Dates and Times coming from. Have they already been captured in a table
along with the ApptNo?
If so, you can add the date and time columns to your ApptNo combo, and use 2 calculated
unbound fields to "display" the associated D&T.
(Don't use Date and Time as names... use ApptDate or ApptTime for ex.)
cboApptNo combo setup ex...
ApptNo ApptDate ApptTime
1425 1/1/07 14:45
txtApptDate Control Source...
= cboApptNo.Column(1)
txtApptTime Control Source...
= cboApptNo.Column(2)

Signature
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
>I have a form based on a query of appointments. I want to be able to have
> the user enter the appointment number (I've used a combo box to allow this),
[quoted text clipped - 4 lines]
>
> BTW---Access 97
Boz - 06 May 2007 15:23 GMT
The date and time is not already captured in the table. The purpose of this
form is to enter the arrival date and time (without giving the user the
opportunity to mess up the correct date and time)
> Boz,
> Where are the Dates and Times coming from. Have they already been captured in a table
[quoted text clipped - 19 lines]
> >
> > BTW---Access 97
Ofer Cohen - 06 May 2007 19:30 GMT
Open the Table n design view, for each of the fields there is a DefaultValue
property.
In the Default you can write
=Now
So every time a new record is added the table, the Date and time will be
added to autmatically to the record in that specific field
=Date()
Will add the date without the time

Signature
Good Luck
BS"D
> The date and time is not already captured in the table. The purpose of this
> form is to enter the arrival date and time (without giving the user the
[quoted text clipped - 23 lines]
> > >
> > > BTW---Access 97
tina - 06 May 2007 17:18 GMT
try adding the following code to the "appointment number" control's
AfterUpdate event procedure, as
If Not IsNull(Me!ApptTimeFieldName) Then
Me!ArrivalDateFieldName = Date
Me!ArrivalTimeFieldName = Now
End If
hth
> I have a form based on a query of appointments. I want to be able to have
> the user enter the appointment number (I've used a combo box to allow this),
[quoted text clipped - 4 lines]
>
> BTW---Access 97