By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

Forms won't save edits to table

P: 6
I have a form that uses an unbound text box to autofill other text boxes by using the combo box and using the following code in vba: me.name.value = me.ID.column(0)

So you type in a ID and autofills other boxes like name, site, etc.

when I choose an ID and autofills these boxes, I want to be able to edit these boxes if I need to change and update an ID on the fly.

The Forms properties has record source as the only table where this information is on query builder. I am able to update the table by using the query but not update the table by editing on the form. Data Entry = No, Allow Additions = Yes, Allow Deletions = Yes, Allow Edits = Yes. The box that will be edited are not locked and are enabled and is bounded to the source from the table.
Aug 3 '17 #1
Share this Question
Share on Google+
10 Replies


PhilOfWalton
Expert 100+
P: 1,430
Need a bot more detail on this.
What is the RecordSource of your form?
What is the RowSource of your Combo Box?

Please send a picture of your Relationship Pane with all the fields in your tables showing.

Read up on reserved words. In your case Name is not good.
Me.Name is actually the name of the current form. If you break the code when running something from a form and type "Print Me.Name" in the immediate window, you will see the name of your form. I have no idea what Me.Name.Value will produce.

Other frequently misused reserved words include "Date", but there is a whole list of them that you can find.

If you really insist on using "Name", you must use Me![Name]

Phil
Aug 5 '17 #2

P: 6
I have a form that uses an unbound text box to autofill other text boxes by using a combo box and using the following code in vba: me.name.value = me.ID.column(0)

So you type in a ID in the unbound combo box and that autofills other boxes like project, site, etc.

When I choose an ID and autofills other boxes, I want to be able to edit these boxes if I need to update an ID's attributes. These autofilled textboxes are bounded to the table in Control Source to the specific attribute. So the text box project is bounded to the table project attribute.

I want to be able to edit the table through a form so I don't have to go to the table or a query and scroll all the way to the right to make a change.

The Forms properties has Record Source as the table All P where this information is on query builder. I am able to update the table by using the query builder but not able to update the table by editing on the form. Property Form is Data Entry = No, Allow Additions = Yes, Allow Deletions = Yes, Allow Edits = Yes. The box that will be edited are not locked and are enabled and is bounded to the source from the table.

Table name is ALL P and the query builder sql code is below for the unbound combo box Row Source

SELECT [All P].ID, [All P].Project, [All P].[Site ID], [All
P].EngineeringRegion, [All P].[Engineering Market], [All P].Active,
[All P].[On Air], [All P].Notes FROM [All P] ORDER BY [All P].ID
DESC;
The event of that combo box is in After update and the vba code is

Me.Project.Value = Me.ID.Column(1)
Me.Site_ID.Value = Me.ID.Column(2)
Me.EngineeringRegion.Value = Me.ID.Column(3)
Me.Engineering_Market.Value = Me.ID.Column(4)
Me.Active.Value = Me.ID.Column(5)
Me.On_Air.Value = Me.ID.Column(6)
Me.Notes.Value = Me.ID.Column(7)
Aug 7 '17 #3

PhilOfWalton
Expert 100+
P: 1,430
Let's try to work this out.

The controls on the form are bound to the ALL P Table, so as you go through the records, you will get the values which you can update.

Th Combo Box is based on exactly the same information, so are you saying you want to overwrite an existing record with another record selected from your combo box? Then you will have 2 identical records except for the ID.

Or are you saying you want to create a new record and set the default values from the Combo box?

I am confused to sat the least.

Phil
Aug 7 '17 #4

P: 6
Thank you for the reply.

I do not want to overwrite an exisiting record or add new ones. I want to edit a records attributes. So if I have ID 12345 in the combo box I want to be able to edit ID's 12345 Delivery Date or other attributes related to it as the combo box autofills the original date. Changing the Delivery Date will be reflected on the table.
Aug 9 '17 #5

PhilOfWalton
Expert 100+
P: 1,430
Sorry, you're not making sense to me anyway.
Are you saying that you want to use the Combo box to find a record, them edit it.

When you say a Record's "Attributes", do you mean a Record's fields or Data?

Phil
Aug 9 '17 #6

P: 6
Sorry about that.

Yes the records' fields. I used the combo box to autofill the textboxes with the records' fields. In the form I click in the combo box of ID's and choose 12345 and then text boxes autofill depending on that specific record's field. So choosing 12345 the Delivery date is autofilled by what 12345 has in the table. I want to be able to edit a field like that for example.
Aug 9 '17 #7

PhilOfWalton
Expert 100+
P: 1,430
Right, I understand what you want, and your description of Autofill is most misleading.

The data is already there. All you want to do is find the record selected by your Combo Box.

What is the RowSource of your Combo Box?
What data do you want to see in the Combo Box?
Which is the Bound Column?
What are the Column Widths?

I repeat, what is the RecordSource of the Form?

Phil
Aug 9 '17 #8

P: 6
The record source was mentioned in my original and second post of this.

The Forms properties has Record Source as the table All P where this information is on query builder. I am able to update the table by using the query builder but not able to update the table by editing on the form. Property Form is Data Entry = No, Allow Additions = Yes, Allow Deletions = Yes, Allow Edits = Yes. The box that will be edited are not locked and are enabled and is bounded to the source from the table.

I don't need help in finding the record selected by the combo box. My form is nearly perfect, I just want to update a records data fields on a table through a form.
Aug 9 '17 #9

PhilOfWalton
Expert 100+
P: 1,430
Sorry, I can not help you further.

Phil
Aug 9 '17 #10

P: 6
The issue I had was resolved. I am able to edit the record through the form.
Aug 17 '17 #11

Post your reply

Sign in to post your reply or Sign up for a free account.