Sam Summers
Registered User.
- Local time
- Today, 17:40
- Joined
- Sep 17, 2001
- Messages
- 939
I have implemented the Resize code as in the Developers handbook which works a treat apart from one form that actually crashes Access?...
This form is opened from a parameter form, so the user selects a Job number from a combobox and then clicks on 'Find' button.
Here is the code for this bit:-
Option Compare Database
Option Explicit
Private frmResize As ADHResize2K.FormResize
Private Sub JobNo_AfterUpdate()
If JobNo.Text = "" Then
Command8.Enabled = False
Else: Command8.Enabled = True
End If
End Sub
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Job"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "JobEmp parameter panel"
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
Private Sub Command14_Click()
On Error GoTo Err_Command14_Click
Dim lngBlue As Long
lngBlue = RGB(0, 0, 255)
Forms![MainPanel]!Command18.ForeColor = lngBlue
Forms![MainPanel]!Command35.ForeColor = lngBlue
DoCmd.Close acForm, "JobEmp parameter panel"
Exit_Command14_Click:
Exit Sub
Err_Command14_Click:
MsgBox Err.Description
Resume Exit_Command14_Click
End Sub
Private Sub Form_Open(Cancel As Integer)
Set frmResize = ADHResize2K.CreateFormResize
Set frmResize.Form = Me
Call frmResize.SetDesignCoords(800, 600, 96, 96)
frmResize.ScaleFonts = True
frmResize.ScaleForm = True
frmResize.ScaleColumns = True
frmResize.ScaleControls = scYes
frmResize.CenterOnOpen = True
End Sub
****************************
So the 'Job' form is opened which contains a subform. Bearing in mind that all this is fully functional in the un-Resized version i have created.
The 'Job' form is based on a query:-
SELECT DISTINCTROW Job.JobNo, Job.Location, Job.Client, Job.Description, Employee.EmployeeID, Employee.FirstName, Employee.Surname, Employee.TeamLeader, Employee.Offshore, Employee.Onshore
FROM Job INNER JOIN (Employee INNER JOIN EmpJob ON Employee.EmployeeID = EmpJob.EmployeeID) ON Job.JobID = EmpJob.JobID
WHERE (((Job.JobNo)=[Forms]![JobEmp parameter panel]![JobNo]))
ORDER BY Job.JobNo;
************************************
The 'Job' form is using this Resize code which works for all the other forms in the database:-
Option Compare Database
Option Explicit
Private frmResize As ADHResize2K.FormResize
Private Sub Form_Open(Cancel As Integer)
Set frmResize = ADHResize2K.CreateFormResize
Set frmResize.Form = Me
Call frmResize.SetDesignCoords(800, 600, 96, 96)
frmResize.ScaleFonts = True
frmResize.ScaleForm = True
frmResize.ScaleColumns = True
frmResize.ScaleControls = scYes
End Sub
*************************
Thanks greatly if you can shed any light on this one otherwise I shall have to scrap the resizing efforts.......
This form is opened from a parameter form, so the user selects a Job number from a combobox and then clicks on 'Find' button.
Here is the code for this bit:-
Option Compare Database
Option Explicit
Private frmResize As ADHResize2K.FormResize
Private Sub JobNo_AfterUpdate()
If JobNo.Text = "" Then
Command8.Enabled = False
Else: Command8.Enabled = True
End If
End Sub
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Job"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "JobEmp parameter panel"
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
Private Sub Command14_Click()
On Error GoTo Err_Command14_Click
Dim lngBlue As Long
lngBlue = RGB(0, 0, 255)
Forms![MainPanel]!Command18.ForeColor = lngBlue
Forms![MainPanel]!Command35.ForeColor = lngBlue
DoCmd.Close acForm, "JobEmp parameter panel"
Exit_Command14_Click:
Exit Sub
Err_Command14_Click:
MsgBox Err.Description
Resume Exit_Command14_Click
End Sub
Private Sub Form_Open(Cancel As Integer)
Set frmResize = ADHResize2K.CreateFormResize
Set frmResize.Form = Me
Call frmResize.SetDesignCoords(800, 600, 96, 96)
frmResize.ScaleFonts = True
frmResize.ScaleForm = True
frmResize.ScaleColumns = True
frmResize.ScaleControls = scYes
frmResize.CenterOnOpen = True
End Sub
****************************
So the 'Job' form is opened which contains a subform. Bearing in mind that all this is fully functional in the un-Resized version i have created.
The 'Job' form is based on a query:-
SELECT DISTINCTROW Job.JobNo, Job.Location, Job.Client, Job.Description, Employee.EmployeeID, Employee.FirstName, Employee.Surname, Employee.TeamLeader, Employee.Offshore, Employee.Onshore
FROM Job INNER JOIN (Employee INNER JOIN EmpJob ON Employee.EmployeeID = EmpJob.EmployeeID) ON Job.JobID = EmpJob.JobID
WHERE (((Job.JobNo)=[Forms]![JobEmp parameter panel]![JobNo]))
ORDER BY Job.JobNo;
************************************
The 'Job' form is using this Resize code which works for all the other forms in the database:-
Option Compare Database
Option Explicit
Private frmResize As ADHResize2K.FormResize
Private Sub Form_Open(Cancel As Integer)
Set frmResize = ADHResize2K.CreateFormResize
Set frmResize.Form = Me
Call frmResize.SetDesignCoords(800, 600, 96, 96)
frmResize.ScaleFonts = True
frmResize.ScaleForm = True
frmResize.ScaleColumns = True
frmResize.ScaleControls = scYes
End Sub
*************************
Thanks greatly if you can shed any light on this one otherwise I shall have to scrap the resizing efforts.......