Sorry for delay ... a major project has taken nearly all waking (and some
sleeping) moments...
See comments in-line below:
deepak said:
Sorry to reply late. I've no internet conn at home . I go out to browse
each day 1hrs.
I will explain the whole thing.
Aim : to search AND/OR enter appointments for given date .
Table : tblAppointments :Fields : Name , Area , Date , PreparedBy
I have a main form : Record source : tblAppointments .
Controls :
text box : Date : double click opens calender control to chose
date.
AfterUpdate event : Requerys subform containing name
and area using vba.
(Search for a date and start entering data)
text box : PreparedBy (name of person)
I have a Sub Form in it : Record source : Same tblAppointments .
Continous forms.
Controls:
text box : name , area , date, preparedby
Linked fields : Date to main forms Date -- and -- PreparedBy to
main forms PreparedBy
If I understand correctly, you have a main form AND a subform, both based on
the same table. You shouldn't need to do this. If your main form is only
used to find appointments on a particular date (your text box?), you can
unbind the control from the table and use the text box as a "search" field.
You'd then not need your subform, since your mainform could use, say,
continuous forms to display all the records for the selected date (you'd
still need to use AfterUpdate to requery the main form).
The first problem is when I give the date (for search and enter) in the
main form nothing shows until i enter the CORRECT name of person in
PreparedBy in main form. Any other way to ignore PreparedBy . ( The
same form is also used for data entry ).
I'm not sure from your description, but perhaps you need both calendar date
and person selection controls (unbound) to retrieve the correct records.
Second when I change the date in the main form , the date of the first
row of data in tblAppointments gets changed .
Is there any another way to do it .
Important : About me
I'm a student 18 doing a msaccess project for a small medical
institution . I will be getting a certificate for it . ( Very
useful to get jobs afterwards)
I know visual basic 6 (70%).
I started learning access only 2 months ago. I got the book of
Jhon Viscas msaccess2003 and finished it 2 weeks.Not
attended any institute for learning access.
I did my whole project using vba code almost no querys used no
macros.
Its nice to get advices from mvp of ms ( hope i become one. )
--
Regards
Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Microsoft Registered Partner
https://partner.microsoft.com/