Blank fields (sometimes)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I am new to Access/VBA. Anyway this is the problem I am having:

When I first type the information on a form (frmTravel) (without closing and
reopening). And I click on a print button (that is on the frmTravel) I get
(on ther report) no or some missing fields that are on the form. But when I
close that form and reopen it will display, if I go back to the form and
change anything it works fine and the changes show up on the report. Here is
the code behind the print button:

Me.Dirty = False
DoCmd.OpenReport "rptTravel", acViewPreview, , "[SSN] = '" & [SSN] & "'"

Thank You for any help..
 
Amour,
Try a Refresh before the report runs. The data you just entered have not yet been
written to the table.
Refresh
Me.Dirty = False
DoCmd.OpenReport "rptTravel", acViewPreview, , "[SSN] = '" & [SSN] & "'"

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
That looks like it works but I am not sure just yet (remember sometimes the
fields display). Thank You much....

Al Campagna said:
Amour,
Try a Refresh before the report runs. The data you just entered have not yet been
written to the table.
Refresh
Me.Dirty = False
DoCmd.OpenReport "rptTravel", acViewPreview, , "[SSN] = '" & [SSN] & "'"

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Amour said:
Hi I am new to Access/VBA. Anyway this is the problem I am having:

When I first type the information on a form (frmTravel) (without closing and
reopening). And I click on a print button (that is on the frmTravel) I get
(on ther report) no or some missing fields that are on the form. But when I
close that form and reopen it will display, if I go back to the form and
change anything it works fine and the changes show up on the report. Here is
the code behind the print button:

Me.Dirty = False
DoCmd.OpenReport "rptTravel", acViewPreview, , "[SSN] = '" & [SSN] & "'"

Thank You for any help..
 
Back
Top