nescionomen93
nescionomen93

Reputation: 49

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.

Upvotes: 1

Views: 182

Answers (2)

Duncan Drake
Duncan Drake

Reputation: 228

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.

Upvotes: 0

Andre
Andre

Reputation: 27634

Your form must be unbound, i.e. its RecordSource must be empty.

Upvotes: 1

Related Questions