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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing data on form

Status
Not open for further replies.

waiwainoo

MIS
Apr 18, 2005
17
GB
Hello
Iam new to Ms Access and am developing a database for a Restaurant.
There is a particular form on which user select the stuff as his order. There is a command button which calculates the total sum. After the sum calculated the new calculation has to be done. So i want the text boxes to get clear from the previous data. For which i build a command button to "refresh data on form" but its not working and giving the error "the command of action refresh isn't available now"

plz tell me what to do.
 
Perhaps Recalc instead of Refresh ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes . i do want to recalculate but for this the user would go to every text box , delete the previous value and then enter new choice.

what i want is a button to clear up all text fields on that form.

I would be really greatful for help
 
Try adding the command button to the form (ill call it CmdClearFields in this example) and in its On_Click property put this in the VBA 'code'.

Code:
Public Sub CmdClearFields_Click()
[Forms]![FormName]![textbox1] = Null
[Forms]![FormName]![textbox2] = Null
[Forms]![FormName]![textbox3] = Null
[Forms]![FormName]![textbox4] = Null
End Sub

rename the formname and textbox# accordingly.
add a line
Code:
[Forms]![FormName]![textbox4] = Null
for every textbox# on the form which needs clearing.

Ian Mayor (UK)

Program Error
Programmers do it one finger at a time!
 
i tried it ... iam using Customer_order_form and for the field text433 i typed in
[Forms]![customer_order_form]![textbox433] = Null
But it is giving me error ... which says Ms Access can not find the form.

any suggesions will be highly appreciated.
 
Might be wrong, but try putting a . between the form and textbox433 (ie replace the !)
 
Is that not easy by going to a new record?
Code:
DoCmd.GoToRecord , , acNewRec
Or post your code behind the form

________________________________________
Zameer Abdulla
Visit Me
There is only one perfect child in this world. Every mother has it.
 
i tried a dot instead of ! but of not vail.
and DoCmd.GoToRecord , , acNewRec is not working either.

can anyone suggest something.
 
We aremissing a lot of things here. We need to know
[ul]
[li] Your table setup and FieldNames [/li]
[li] Your FormNames including subform if there [/li]
[li] Relation between Master/Child forms [/li]
[li] Code behind the form [/li]
[/ul]

________________________________________
Zameer Abdulla
Visit Me
There is only one perfect child in this world. Every mother has it.
 
There is a main form called "Main" which has several buttons on it. One of its button calls the sub form "Customer_Order_Form".
The "Customer_Order_Form" do not have any sub form.
The fields on Customer_Order_Form are Text Boxes. The user simply selects the stuff he needs from Combo box and then type the number quantity against it in a text box ... and the total price appears in third text box.
Now when the operation is performed on all over the form ... there is a button which on click calculate the GRAND SUM.
Now for next user using this form .. i want the prevous data from text boxes to removed.

Plz help me out.
 
Forms!Main!Customer_Order_Form.Form!textbox433 = Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I was still having that error after writing

Forms!Main!Customer_Order_Form.Form!textbox433 = Null
and it was saying that Ms Access couln't find the form.
But
I have my problem solved just by writing
text433 = Null

Funny Enough :)

Anywayz ... Thanks alot all of you .. coz i got it by your help.

Thanks again


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top