Solved

Opening pop up form - buttons not showing

Posted on 2013-01-21
12
374 Views
Last Modified: 2013-01-21
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:

Opened from other form (Employee)
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)

Opened on its own
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?
0
Comment
Question by:correlate
  • 6
  • 5
12 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 38800856
Check your popup's Data Entry mode, and  make sure that it is set to "NO" if you want to view existing data.
0
 

Author Comment

by:correlate
ID: 38800875
Hi Mbizup

Thanks for the reply - Done that - no difference I'm afraid.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38800889
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).
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:correlate
ID: 38800915
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

0
 
LVL 61

Expert Comment

by:mbizup
ID: 38801017
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)?
0
 
LVL 14

Assisted Solution

by:Bill Ross
Bill Ross earned 125 total points
ID: 38801045
Hi,

Looks to me like you have a text box overlapping the Close button.  When data is displayed it pop to the front covering the Close button.

Regards,

Bill
0
 

Author Comment

by:correlate
ID: 38801067
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
0
 

Author Comment

by:correlate
ID: 38801074
Hi BillDenver

Alas its not that - have just double checked
0
 
LVL 61

Accepted Solution

by:
mbizup earned 375 total points
ID: 38801157
I can't open the database in .accdb format at the moment - other Experts should be able to help...

But my own guess is also along the same lines as what BillDenver is suggesting -- textbox (or some other control) getting 'set to the back' under some conditions.

Give this a try --

- Create a header section for your form
- Color the background of your header section red (use the section background for the red color instead of rectangles or any other control)
- Place the textbox and close button in your header section, ensuring that no controls, labels, rectangles etc are overlapping each other.
0
 

Author Closing Comment

by:correlate
ID: 38801348
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
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38801395
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)
0
 

Author Comment

by:correlate
ID: 38801419
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
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Flowing down data to other tables 13 36
trouble referencing field on sub form 8 38
Run an action on recently added records to a table 13 67
Use after update to change dates 2 18
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question