Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autoload one form after loading another 1

Status
Not open for further replies.

paulwood

IS-IT--Management
Apr 10, 2001
896
GB
This may be simple, but I'm not a DB programmer, I just got landed with a problem by a client :-(

I have a contact management form running, and have another form linked to a query which pops up appointment reminders when a button is clicked. This all works, but now I need to open the second form immediately the first form has loaded, so the reminders are shown. How can this be done?

Thanks
 
You might try pasting the code from the click event of the button that you use to open the reminders form into the form load event of the main form....
 
I have added some vb coding to my access. below are it. In the refrence, I also have added

Microsoft DAO 3.6 Object Libarry,Microsoft ACtivex Data Objects 2.1 Library,Ole Automation, Visual Basic for Application, Microsoft Access 9.0 Object Library.

But at the """"" sign, I get the 'type mismatch ' error.

Dim db As Database
Dim wsp As Workspace
Dim rstemployee As Recordset

Set db = DBEngine.Workspaces(0).OpenDatabase("c:\programming\helpportal\helpportal.mdb")
Set wsp = DBEngine.Workspaces(0)

""""" Set rstemployee = db.OpenRecordset("employees", dbOpenDynaset)

rstemployee.Index = "primarykey"
rstemployee.Seek "=", cmbStaffID.Value
If rstemployee.EOF = True Then
MsgBox "Please Enter Valid Employee Id"
cmbStaffID.SetFocus
Else
txtName.Value = rstemployee.Fields("FName")
txtDesignation.Value = rstemployee.Fields("Title")
txtDepartment.Value = rstemployee.Fields("Dept")
End If

can anyone help....
thanks
 
Thanks jitter

I actually attached a macro to the form load and it worked, except that the reminder form opens before the main form does, darn, I had hoped to have the main form open in the background. It may now be irrelevant, they liked the popup so much, they now want it to poll periodically during the day and pick up appointment times as well to provide Outlook-like alarms. Does anyone know if this can be done in Access? I'm off to read some books :p
 
PaulWood,
Thinking about this, perhaps you could use the main forms "On timer" event along with some vb code to periodically do checks to see if there are any new appointments etc and if so, pop up the appointment form.

(Alia, looks like you posted your problem as a response to someone elses issue by mistake)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top