Form (List Boxes) Updating (n00b)

Jack Hammmer

Database n00b
Local time
Today, 22:04
Joined
May 9, 2009
Messages
7
I have a form in which I require a button to save information such as:

Customer ID (General Number) (Text Box)
Services ID (Autonumber) (List Box - qry_Services)
Service (Text) (List Box - qry_Services)
Description (Text) (List Box - qry_Services)
Price (Currency) (List Box - qry_Services)
Date of Purchase (Short Date (=Now())) (Text Box)
Purchased (Query) (List Box - qry_Services_Customer)

To a table (tbl_Services) and I am unsure how to do this. I do not have any previous knowledge of VB and very little of SQL; so searching through similar threads confused me as I do not know the syntax or operators.

I also have a list box below the other boxes in the form which displays the services which the customer has bought via the Customer ID: This works well although to update the information one has to close and re-open the form. I was wondering if there was some VB code that could update the information for me and if so where would I enter it?

I apologise as I am unaccustom to Access and require this for a college project. I would like a button that simultaniously saves the fields in the form to the specified table and the updates the List Box.

Thanks in advance, Jack.

If anybody requires my database for reference (It is not labeled very well) I would happily email it to them as I cannot seem to upload it.

The Access World Forums database has encountered a problem.
 
I have figured out that when the information has been changed and the 'Refresh' / 'Refresh All' button is clicked in Access that the form and list box information are updated and correct; is there a way to emulate the refresh with VBA? I have tried:


Private Sub Purchase_Click()
On Error GoTo Err_Purchase_Click

Me.Refresh

Exit_Purchase_Click:
Exit Sub

Err_Purchase_Click:
MsgBox Err.Description
Resume Exit_Purchase_Click

End Sub

Though this doesn't appear to do anything (I think it is because it is refreshing the form rather than the query and list box). Thanks again...
 
Try Me.Requery instead of refresh however seeing the actual DB might allow for a better solution

regards John :)
 
I should of said earlier I have also tried Me.Requery and that appears to do nothing also. I have tried uploading the database so it can be viewed but everytime I have tried, the website would not allow me.

When I tried Forms!frm_Facilities!Purchased.Requery it did update the list box although it would not select the relevant information from the Customer ID it would just refresh the same information. I did have the List Box (=[CID]) (Customer ID of the form) then when I requeried the information if would then refresh and select the Product ID for the previous Customer ID instead of loading new information relevant to the new Customer ID.
 
Have you tried zipping the database first to reduce its size when posting?
 
I have checked the file size (690kb) under the limit of 750. I will try zipping and uploading again though.

Reducing the file size has worked; thankyou. I have now uploaded the file so you can view the database.
 

Attachments

Users who are viewing this thread

Back
Top Bottom