I have created a form in Access that corresponds to a table with zero attributes - vba

I have created a form in MS Access. The corresponding tables for these forms have zero attributes. I simply created a blank form and manually inserted text boxes, labels, check boxes, etc. Now I would like to capture specific information that is entered into the form. How would I go about this in MS Access? Do I need to write some VB code to say "record whatever value the user puts in the field for serial number" for example? There is no preexisting data in any tables.
A user will manually fill out the form in Access, I would like to capture the data that the user inputs.

Bind the table to the form and then bind the controls to the fields of the table.
Or, the easy route: Mark the table in the navigation pane, then click in the band: Create and then Form, and it will do the dirty work.

Related

MS Access - Continuous form custom text entry

Good Morning All,
I am wrestling with a problem with continuous forms.
I have a continuous form based on a query that pulls transaction information from a table.
I want to have text box on each row where the user can override the fee value, at which point when the submit button is clicked the overridden information is written into a second table in the database.
When I add an unbound text box onto the continuous form I end up with all entries reflecting the amount I have just entered.
If I add a dummy column onto the SQL query, I am unable to edit the information.
Is there a way to do this? Below is an example of the form input I am shooting for:
Snip:
I don't think this can be done in Access.
I think the closest you can get, is to display the value from the secondary table in your continuous form; and then, after some user input (focus into the textbox, or double-click the text box, or button click), prompt the user to enter a value using either the VBA InputBox function, or leveraging the built-in Zoom box. Check that the user-entered value is a valid number, update your external table, and refresh the query results.
You might also create a custom form to validate the input.

VBA access and forms

I created a database in Access and there are some type of records in some tables that requires a particular inserting, so I decided to use VBA to handle this.
The problem is that if i create a form with some controls which i want to refer and use their values as criteria for queries, the form is still a way to insert data. So the query works but the data i inserted are added directly from the form too, creating duplicates.
The question is, is there a way to create a form that has controls only for text input but does nothing to record , leaving inserting, deleting , updating all to queries in VBA?
I tried to put "no" on propriety "add records" in the form but it gets totally blank with no controls.
Your form must be unbound, i.e. its RecordSource must be empty.
Your form can be bound or not bound to a table / query.
This means that the controls on your form may be bound to a field of that table / query.
But you can also have controls in the same form which are not bound.
Example:
You can make a form in which the body has a list view of the records of the table. In this section the controls would be bound to a field.
In the header of the table instead you may have controls that are not bound and that could be used either to filter the records shown or to add new records. You may want to add records this way rather than let users insert data directly in order to add checks or do any other kind of processing before actually adding the data in a new record.

Trying to open another form in Access based on a field in the current form

I have a form that's just a list of descriptions (desc.) of other forms. Right now, when you click on a desc., the appropriate form opens; but it's done through a series of if statements in a macro. This isn't going to scale well once more forms are created.
I have a table that has the desc. and the form that is supposed to go to. I want to write a script that uses this table to open the new form based on the desc. clicked, but not using if statements. The end goal is to be able to just add a row to the table for any future forms that are created without making changes to the script or form. Is there a way to do this?
Use a combo box whose row source is a query which selects the form description and name fields from your table.
The combo will have 2 columns. You can set the width of the form name column to zero if you want to present only the form descriptions. If you make the form name column the combo's bound column, you can reference it conveniently in a DoCmd.OpenForm statement. For example, you could have a command button whose click event opens the form which is currently selected in the combo ...
DoCmd.OpenForm Me.YourComboName.Value

Individual Record Subform

I am fairly new to access and I am wondering about a form.
In my form, I want to have certain field values displayed based upon which row the user selects.
So, pretend a user selects Row B, I want a subform that displays data from only Row B.
Is this possible, and if so how? :)
Thanks!
You don't even need a subform for this.
Your main form is a continuous form and your data rows are displayed in the form's detail area, right?
If yes, you can just put bound textboxes in the form header or footer, and they will display the value of the selected row.
Here are some example screenshots I just made.
It's Access 2000 and it's in German (that's the only Access version that I have here), but you'll get the idea.
Design mode:
("Formularkopf" means "form header", and "Detailbereich" is "Detail" in English Access versions.)
At runtime:
Note that the textbox in the form header, which is bound to Field2, automatically displays the value of Field2 in the currently selected row.

Auto populating text boxes on an Access 2003 form when value selected in combo box

I am building a form in access database.
I have a combo box which is linked to a query which is looking up a unique reference number from a table called Tbl_Submitted_Requests.
What I need the form to do is auto populate the other text boxes when the user selects the unique reference from the combo box. How can I get the text boxes to auto populate with the data that is associated with each unique reference?
Thanks
First, bind your form to Tbl_Submitted_Requests or better, a query that uses this table, you can do this with the form wizard or by setting the Record Source property of the form. Each of the textboxes will also need to have a control source set to the name of a field (column) Next, add a combo and choose "Find a record on my form based on the value I select in my combobox" from the wizard options.
I will agree with Remou's response, with one small edification. Crate a new form, and drag all of the fields from the relevant query or table onto this form. Alternatively, you can drag them from the field chooser if the form has already been bound. Then, create your combo-box, and choose "Find a record on my form based on the value I select in my combobox" from the wizard options.