Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ms access form with just close x 1

Status
Not open for further replies.

patriciaxxx

Programmer
Jan 30, 2012
277
GB
These are the form settings:
Close Button = Yes
ControlBox = Yes
BorderStyle = Dialog
MaxMinBitton = None

The above setting gives me the Close button (X) but also the form ControlBox.

If I change the settings to:

Close Button = Yes
ControlBox = No
BorderStyle = Dialog
MaxMinBitton = None

Both the Close button (X) and the form ControlBox, infact all buttons, are removed.
I would like to display the close button (X) only and none of the forms other buttons / controls.

Does anyone know how this could be achieved, maybe using API and the forms handle or something?
 
>hWndDlg = CreateDialogIndirectParam(0, d.dlgtemp, hwnd, AddressOf DlgFunc, 0)

If you've got the above line commented out and the error is appearing then it isn't the message handling code (the bit that would explode Access)that is causing the problem. It suggests there is a problem with changing your Form's parent with the SetParent command.

If you step through the code from the commented out line onwards, where exactly does the error occur?
 
I’m not getting any errors here Access just freezes and crashes.

Unless you think there’s a fix in sight I’m ok with letting this one go rather than taking up any more of your time. You really did try for me and for that I’m very grateful as always.
 
strongm

Please let me know if you don’t have a fix so I don’t miss a later update on this tread.

Thank you
 
I don't have a fix because I'm not seeing the problem on my test rig, and I've given the debugging ideas that currently occur to me.

I guess I could check:

>Access just freezes and crashes

If you line step through the code, which line does this happen on (leaving the hWndDlg = CreateDialogIndirectParam(0, d.dlgtemp, hwnd, AddressOf DlgFunc, 0) still commented out - if you try and step through that you'll definitely blow up ...)? SetParent?
 
I can step through the code without any problem until I hit the line below. When I step through that line Access freezes and then wherever I click Access crashes.

Code:
SetParent hwnd, hWndMyDialog
 
Yep, I guess it would. Hmm ...

Works fine here, I'm afraid, so I can't offer any additional input at this stage.
 
Just out of interest what version of Access were you using?

Thank you for all your posts your help and time are much appreciated.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top