Form & Query Problem

G

Guest

I've created a form that can be used as a new record in a database or to
modify an existing record in a database. I have a query that links the form
to the database. When I use the form, the query is inserting the existing
records into the new form and not displaying the modification form at all.
How do I get Access to display a new form, without existing records, when I
chose that option and the edit-phase of the same form, complete with records,
when I select that option?
 
G

Guest

Greg,

A form is populated by the records in the table or query defined in its
RecordSource property. By default, when you open a form, it will contain all
records so defined. The easiest way to use the same form for entering new
records is to set its DataEntry property to true:

....code that opens your form...
Forms!YourForm.DataEntry = True

Hope that helps.
Sprinks
 
G

Guest

Thanks for the reply. My problem was that my query wasn't updating, because I
was using inner joins instead of left joins. When I changed that everything
fell into place. Almost, I have one combo box on my form that when I try to
change it, I get the message, "Can't Be Edited, Bound To Unknown Field". Can
I get some help with that? Thanks
 
G

Guest

Hi, Greg.

A combo box has several key properties, which you can change or view by
showing the Properties window (View, Properties or right-click the control,
Properties):

RowSource SQL query statement that provides the rows of the combo box
ColumnWidths How much space to allocate to each column
BoundColumn When a selection is made, which column is stored
ControlSource The name of the field into which the BoundColumn is stored

Your error indicates that the field specified in ControlSource is not a
field in the underlying RecordSource of the form. Available fields are shown
in a drop-down box in the ControlSource property.

Side note: what is *displayed* after making a selection is the first
non-zero-width column. This may be, and often is different from the
BoundColumn. For example, if selecting a customer, one usually wants to
display the company name, but store the foreign key CustomerNumber. Assuming
the CustomerNumber is the first column, this is accomplished by making the
BoundColumn equal 1, and setting the first ColumnWidth to 0".

Hope that helps.
Sprinks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top