Printing Issues

DJ100

Registered User.
Local time
Today, 21:28
Joined
Jul 4, 2002
Messages
34
Hi,

I have created a database for multiusers, have split the frond end etc and all is working well.

My only problem now is that I have hidden the database window and tool bars on the Users PC's BUT I have a button on one of my forms which opens another form and prints it.

When I click this button it opens the database window - the users then have access to this which I am trying to prevent!

Any advice as to how I can stop this happening??

Cheers

DJ
 
It sounds like your button is not tied to the correct thing (the form that you wanted). Check the On Click event procedure. It should have the form name in it.

Autoeng
 
It appears to be . . will look further - however, I now have another problem. On the Users machines the database window opens minimised - even though it is not ticked in startup - on my machine however is doesn't open at all - all the machines are set up the same . . .

Any suggestions
 
Have you under Tools - Startup unchecked the Display Database Window box? Distributed the correct front end to your users (this is what it sounds like you are not doing)?

You can put this in your forms On Open event.

Private Sub Form_Close()
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide


End Sub

Autoeng
 
Thanks for that - I will re-distribute the front end from my machine

The code in the button is as follows

Dim stDocName As String
Dim MyForm As Form
'Stamps todays date to date provisional booking letter sent
Me.[DateBookingLetterSent] = Date
stDocName = "frmProvisionalBookingLetter(Add)"

stLinkCriteria = "[OrderID]=" & Me![OrderID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut , , , , 2
DoCmd.SelectObject acForm, MyForm.Name, False
DoCmd.Close
 
I'm fairly new to coding but it doesn't appear that Access knows what form you are looking for. Add the following after Dim MyForm As Form. Rich is much better than I am so maybe he will chack this to see if I am correct.


stDocName = "MyForm"

Autoeng
 
Form's aren't really designed for printing, use a report and you'll have less trouble and code
 
Thanks for that (again) i understand that forms aren't great for printing but sometimes it's just easier to print a form than produce a report with the same layout containing all the information . . .

My problem with the database window is a weird one - I have distributed the FE from my machine to the other users - and they perform the same as mine UNTIL I allocate another Icon in startup. As soon as I do this the database window opens again.. . . as soon as I delete the link to the Icon everything is OK.

On MY machine however, the icon is displayed no problem and the database window is not displaled . . . ..

Weird
 
I'm not following you.

they perform the same as mine UNTIL I allocate another Icon in startup (what do you mean by this?)

Autoeng
 
I have seen code to work around this sadly, I can't remember where, I think the autoexec macro is your easiest option
 
Reply to autoeng . . .

Sorry if I'm being vague . . . you know it is possible to put a new Icon in the top left hand corner of the open window and it is also possible to assign the same macro to reports and forms . . . (to replace the access "key") - i.e to personalise the application.

Well, anyway on my machine I can do this no problem. But on the other machines as soon as I change this the Database Window is displayed - I don't understand this at all as I am sure that all the machines are set up the same.

I am wondering if perhaps I should re-install access on the other two machines, but this would be an absolute last resort. On the other hand I could abandon changing the icon - then there is no problem - just thought it would look nice!
 

Users who are viewing this thread

Back
Top Bottom