Little bug!!

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

HI!!
I having problems with a form in perticular..

This form allows a user to enter data, and its
RecordSource is connected to a table. So I can navigate
through the all ready existing records and add new one.

One a user adds a new record, the page is blank, and
he/she fills-in the appropriate boxes with data. So far so
could.. But sometime, when the user clicks on the print
button(to print current form), the appliaction pops a
message to the user, saying something like:
----------------------------------------------------------
Blablabla...
Then
Save changes Discard changes and something else.
-----------------------------------------------------------
All they have to due is push-on the save changes and
everything returns to normal.(The page also Prints)

The '-' represents the size of the msgbox that appears on
the screen.

I though that perhaps this form needs to be saved(in some
way), since its a new record... I don't know what to think.

Since the new record is connect,via recordSource, to a
table could it mean that there's a delay between the time
that the data is entered in the text boxes on the form to
where its actually saved permanently in the table.

Would I require some sort of 'save' or refresh, in my
print button.

Any Help will be appriciated, I'm at a lost here,
Thank you very much,
PAtrick
 
Patrick said:
HI!!
I having problems with a form in perticular..

This form allows a user to enter data, and its
RecordSource is connected to a table. So I can navigate
through the all ready existing records and add new one.

One a user adds a new record, the page is blank, and
he/she fills-in the appropriate boxes with data. So far so
could.. But sometime, when the user clicks on the print
button(to print current form), the appliaction pops a
message to the user, saying something like:
----------------------------------------------------------
Blablabla...
Then
Save changes Discard changes and something else.
-----------------------------------------------------------
All they have to due is push-on the save changes and
everything returns to normal.(The page also Prints)

The '-' represents the size of the msgbox that appears on
the screen.

I though that perhaps this form needs to be saved(in some
way), since its a new record... I don't know what to think.

Since the new record is connect,via recordSource, to a
table could it mean that there's a delay between the time
that the data is entered in the text boxes on the form to
where its actually saved permanently in the table.

Would I require some sort of 'save' or refresh, in my
print button.

Any Help will be appriciated, I'm at a lost here,
Thank you very much,
PAtrick

LOL "Blablabla..." is not a very helpful summation of the error
message. Next time, try pressing Ctrl+C when the error message is
displayed, to copy it to the clipboard, and then paste it into the text
of your newsgroup message. That usually works.

My *guess* is that you're getting the message "You and another user are
attempting to change a record at the same time ..." (or something like
that, though I'd need to see the code behind the Print button to see
why. Probably you need to add a line in that code to save the current
record before you run the report. Please post the code, and I'll see
what I can recommend.
 
Dirk: here's the code:
In the 'Click event' of my print button...

Dim fc As String
On Error Resume Next

lblFYr.Visible = True
lblFYr2.Visible = True
fc = mId(FYears, 4, 9)
lblFYr2.Caption = fc

DoCmd.PrintOut acSelection, , , , , False

lblFYr.Visible = False
lblFYr2.Visible = False

Sorry for the 'Blablabla', but I couldn't remember exactly
what it was(from memory), the only thing that I distinctly
remembered was the 3 buttons...

Thanks again,
PAtrick
 
Patrick said:
Dirk: here's the code:
In the 'Click event' of my print button...

Dim fc As String
On Error Resume Next

lblFYr.Visible = True
lblFYr2.Visible = True
fc = mId(FYears, 4, 9)
lblFYr2.Caption = fc

DoCmd.PrintOut acSelection, , , , , False

lblFYr.Visible = False
lblFYr2.Visible = False

I have to say I'm a bit puzzled as to what's going on in this routine
aside from the DoCmd.PrintOut. Are these labels being made visible and
invisible again? Surely their visibility can't last very long. I'm
guessing that you typed this into your message rather than
copy-and-pasting it; else how did you manage to get the Mid() function
capitalized that way? I mention this only because, if you did
copy-and-paste it, something's wrong somewhere in your database.

I don't see any obvious reason here for a lock-out message, which I
guessed is what you're seeing. Still, try inserting this line of code
before the call to DoCmd.PrintOut:

RunCommand.acCmdSaveRecord

and see if the error goes away. If doesn't, if it's raised again, I'll
ask you to identify (by setting a breakpoint on the routine and tracing
through the code) the exact line of code that raises the error, and to
post all the code from the form's module.
 
Thanks again for your input, I will give this a try..
As to my labels, they appear only on the printed for. It
represents the current fiscal year that the user is in..

Thanks again,
PAtrick
 
Back
Top