Adding Data to Query (1 Viewer)

kipster1203

Registered User.
Local time
Today, 14:39
Joined
May 5, 2010
Messages
13
Hopefully I can explain my problem well enough for someone to help me out, if you need more info let me know.

In my program, the user accesses a popup window where he can input revision reasons, and I have a bunch of reasons and he can put a 1 next to the correct reason. Now, I just added a text box next to each reason so that the user can further comment on the revision. This data gets recorded to a Query that contains the reasons on the first row, the second row contains the an integer value (how many revisions were caused by this particular reason), and when they enter a comment, I want that comment to go below the corresponding reason. So far, I created a text box next to every reason, and so I want the comment to be recorded in the corresponding field after update.

Hope this makes some sense, could someone help me with the coding that would go with each comment box? thank you
 

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 09:39
Joined
Jul 15, 2008
Messages
2,271
Why record the comment to a query?

At what stage is the pop up working ie does it provide data for a new record or add data to a field in an existing record.
If the record exists, can you have a subform open that will allow the comment to be recorded into the correct field?

If your pop up creates a new record then can this be done and then a subform will allow the data to be entered into the field.
A command button can create the record (run an append query) and then open a form that asks for more comments on the record just created.
 

pkstormy

Registered User.
Local time
Today, 16:39
Joined
Feb 11, 2008
Messages
64
Not sure I fully understand but here are a couple of things I typically do:

1. Have an unbound combobox (ie. in the header of the form) so that when a user selects a value, I requery the recordset (me.requery) which has criteria in that recordset to return only records where the key field matches the same value in the combobox.

2. If I want to populate another field based on what the user enters for a specific combobox, I'll use the AfterUpdate event of a combobox to set the value in a textbox (which is editable).

For example
Private sub MyCombobox_AfterUpdate()
me!SomeOtherTextField = me.MyCombobox.Column(1) 'Where combobox column(1) is the value I want stored into the SomeOtherTextField.
End sub

Depending on how you set this up, the rowsource for the combobox can have values from a 'lookup' type table or from the actual data table itself (but showing only unique values).
 

Users who are viewing this thread

Top Bottom