Solved

Opening pop up form - buttons not showing

Posted on 2013-01-21
12
339 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
 

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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now