Link to home
Start Free TrialLog in
Avatar of Tom Crowfoot
Tom CrowfootFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Opening pop up form - buttons not showing

Dear Experts:

I'm baffled by this one - I have a pop up form called "AddHRLog" which is accessed from another form called "Employee".  When I access it from the form employee the form header doesnt go cross the full width & also the close button don't appear - see below:

User generated image
When I open it one its own the header & button are all OK: (the error message is because of a dlookup that is trying to cross reference an ID field to the main table)

User generated image
The only difference it that when I access it from the form "Employee" its opened in "Add mode" and also one piece of data gets passed across (employeeID)

Any Ideas?
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Check your popup's Data Entry mode, and  make sure that it is set to "NO" if you want to view existing data.
Avatar of Tom Crowfoot

ASKER

Hi Mbizup

Thanks for the reply - Done that - no difference I'm afraid.
Check any code/macros that you might have associated with opening the form.

Check both in the Employees form and also in the Open and Load events of your popup and post any code here... or post a sample database (preferably in .mdb format).
Hi

The only code in the pop up form is on a close button ...

Option Compare Database
Option Explicit
Private Sub CloseAddHR_Click()
DoCmd.Save
Forms!Employee!.Requery
DoCmd.Close
End Sub

Open in new window


The code to open the pop up form from the "Employee" form is...

Private Sub AddHRLog_Click()
On Error GoTo AddHRLog_Click_Err

   Dim frm As Access.Form
   Dim lngEmployeeID As Long
   
   lngEmployeeID = Me![EmployeeID]
   DoCmd.OpenForm "AddHRLog", , , , acFormAdd
   Set frm = Forms("AddHRlog")
   frm![EmployeeID].Value = lngEmployeeID


AddHRLog_Click_Exit:
    Exit Sub

AddHRLog_Click_Err:
    MsgBox Error$
    Resume AddHRLog_Click_Exit

End Sub

Open in new window

I don't see anything obvious there.

It looks like you might have a syntax issue in your close event:

>> Forms!Employee!.Requery

Should be

Forms!Employee.Requery

And I would write your click event code like this:

Private Sub AddHRLog_Click()
On Error GoTo AddHRLog_Click_Err

   Dim lngEmployeeID As Long
   
   lngEmployeeID = Me![EmployeeID]
   DoCmd.OpenForm "AddHRLog", , , , acFormAdd
 
   Forms!AddHRlog![EmployeeID].Value = lngEmployeeID


AddHRLog_Click_Exit:
    Exit Sub

AddHRLog_Click_Err:
    MsgBox Error$
    Resume AddHRLog_Click_Exit

End Sub

Open in new window


Any chance of seeing a database sample (preferably .mdb format)?
SOLUTION
Avatar of Bill Ross
Bill Ross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks - made those changes, I have tried to save as an mdb, but alas it wont let me.  Attached is the full accd version (still very much under construction) - sorry about that
HR.accdb
Hi BillDenver

Alas its not that - have just double checked
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys - there didn't look like any overlapping controls etc, so I rebuilt it the header from scratch & tested step by step. The issue arises when I change the text box (the one with the dlookup in it) to background = transparant.  Keeping it the same colour as the header background did the trick - not sure why, but problem solved - thanks
Just checking...

Look at the properties of your DLookup textbox.

It should have:

Locked: Yes
Enabled: No

I believe with those property settings, you would have no issues with transparent backgrounds (except poss. in Access 2007, which is quirky with control back colors) - and the focus would not be able to get set to that control (which could also affect the appearance)
Interesting - these were the other way round - so have changed these. Alas changing them made no difference to problem when the text box is transparent though