Connecting Tech Pros Worldwide Forums | Help | Site Map

Cannot Save unbound text

Familiar Sight
 
Join Date: Nov 2006
Posts: 134
#1: Jan 5 '08
I have an unbound text - txtfreight on a Subform, when I enter a value , it does not save to the Main form table immediately, unless I close and open up the form. How can I force to save immediately so that I can preview report , since report would be reading the values from the from the underlying table rather than the open form.

I have tried using Forms.frminv.Recalc or Requery , ok this time it save but it cause all other calculated unbound texts value to display #error and keep looping So I remove the Recalc or Requery

How can I resolve it ?

1. In the After Update Event -
2.
3.Forms.frminv.freight = Forms.frminv.frmSubInvoc.Form.txtFreight
4.DoCmd.RunCommand acCmdSaveRecord
5.' forms.frminv.recalc ' Remark off as cause hang

In the Default Value -
=[Forms]![frminv]![Freight]

Familiar Sight
 
Join Date: Nov 2006
Posts: 134
#2: Jan 5 '08

re: Cannot Save unbound text


Quote:

Originally Posted by jamesnkk

I have an unbound text - txtfreight on a Subform, when I enter a value , it does not save to the Main form table immediately, unless I close and open up the form. How can I force to save immediately so that I can preview report , since report would be reading the values from the from the underlying table rather than the open form.

I have tried using Forms.frminv.Recalc or Requery , ok this time it save but it cause all other calculated unbound texts value to display #error and keep looping So I remove the Recalc or Requery

How can I resolve it ?

1. In the After Update Event -
2.
3.Forms.frminv.freight = Forms.frminv.frmSubInvoc.Form.txtFreight
4.DoCmd.RunCommand acCmdSaveRecord
5.' forms.frminv.recalc ' Remark off as cause hang

In the Default Value -
=[Forms]![frminv]![Freight]

Hi , I manage to solve by adding refresh, just don;t know why requery and recalc don't work.
puppydogbuddy's Avatar
Expert
 
Join Date: May 2007
Location: Florida
Posts: 1,915
#3: Jan 5 '08

re: Cannot Save unbound text


Quote:

Originally Posted by jamesnkk

I have an unbound text - txtfreight on a Subform, when I enter a value , it does not save to the Main form table immediately, unless I close and open up the form. How can I force to save immediately so that I can preview report , since report would be reading the values from the from the underlying table rather than the open form.

I have tried using Forms.frminv.Recalc or Requery , ok this time it save but it cause all other calculated unbound texts value to display #error and keep looping So I remove the Recalc or Requery

How can I resolve it ?

1. In the After Update Event -
2.
3.Forms.frminv.freight = Forms.frminv.frmSubInvoc.Form.txtFreight
4.DoCmd.RunCommand acCmdSaveRecord
5.' forms.frminv.recalc ' Remark off as cause hang

In the Default Value -
=[Forms]![frminv]![Freight]

See below:

1. In the After Update Event of txtFreight on subform
2. If Me.Dirty Then
Me.Dirty = False
End If
3.Forms!frminv!freight.Value = Me!frmSubInvoc!txtFreight
4.' DoCmd.RunCommand acCmdSaveRecord <should not be needed, but try both ways, with this code commented out and with code in>
5.Forms!frminv.recalc


It should not be noticeably slower if coded correctly. Also, note comments in #4
Familiar Sight
 
Join Date: Nov 2006
Posts: 134
#4: Jan 5 '08

re: Cannot Save unbound text


Quote:

Originally Posted by puppydogbuddy

See below:

1. In the After Update Event of txtFreight on subform
2. If Me.Dirty Then

Me.Dirty = False
End If
3.Forms!frminv!freight.Value = Me!frmSubInvoc!txtFreight
4.' DoCmd.RunCommand acCmdSaveRecord <should not be needed, but try both ways, with this code commented out and with code in>
5.Forms!frminv.recalc


It should not be noticeably slower if coded correctly. Also, note comments in #4

I tried but don't work, it cause other calculated unbound textboxes display "#error".
puppydogbuddy's Avatar
Expert
 
Join Date: May 2007
Location: Florida
Posts: 1,915
#5: Jan 5 '08

re: Cannot Save unbound text


Quote:

Originally Posted by jamesnkk

I tried but don't work, it cause other calculated unbound textboxes display "#error".

Can you step thru/debug the code and tell me which line is generating the # error. Maybe the code sequence is not correct. More info would be helpful...that is... if you are still interested in pursuing this in light of your statement that the refresh method works for you.
Familiar Sight
 
Join Date: Nov 2006
Posts: 134
#6: Jan 5 '08

re: Cannot Save unbound text


Quote:

Originally Posted by puppydogbuddy

Can you step thru/debug the code and tell me which line is generating the # error. Maybe the code sequence is not correct. More info would be helpful...that is... if you are still interested in pursuing this in light of your statement that the refresh method works for you.

Thanks will try it out
Reply