Chronological Log

mdg

Registered User.
Local time
Today, 11:14
Joined
Feb 17, 2011
Messages
68
I have a form where I enter and update data for dozens of different schools. I have a button on this form that opens up another form (using gotocontrol) that I call 'SchoolChronologicalLog' that is used to enter phone calls and other ongoing communications for the displayed school into a table called tblChronoLog which contains all the chronological log records for all the schools. The query uses [Screen].ActiveControl] to pull up only the log records for the currently displayed school using a unique SchooID field. It works fine and I can enter the data, however, I have to either type in the SchoolID or use a combo box each time I make a new entry. Is there a way to auto-fill the SchoolID.field based upon the current school being diplayed on the main form? This way I can simply click on the 'Log' button on the Main School form and start entering the data right away without having to type in the schoolID each time.
 
Yes if you setup a tempvar you can capture the currently selected ID and use that tempvar in your chrono form.
 
I'm a little fuzzy about exactly what you're doing, here, especially the part about using gotocontrol to open the log form, but this kind of thing is normally done using code like this.

In your primary form:
Code:
Private Sub LogButton_Click()
  DoCmd.OpenForm "SchoolChronologicalLog", , , , , , Me.SchoolID	
End Sub
Then, in the SchoolChronologicalLog form:
Code:
Private Sub Form_Load()
  If Len(Nz(Me.OpenArgs, "")) > 0 Then
    DoCmd.GoToRecord , , acNewRec
    Me.SchoolID = Me.OpenArgs
  End If
End Sub
Linq ;0)>
 
Thanks missinglinq.... I will give it a try later when I have a chance to work on it again. I was using the gotocontrol to highlight SchoolID field that sorts the school logs in the querry. I take it the first code you show does the same thing. I'll use your code instead.
 

Users who are viewing this thread

Back
Top Bottom