Flip control between bound and unbound

G

Guest

Access 2003. Looking for possibility to use VBA code to flip a control
between a bound and unbound control depending upon certain conditions. I
know opening a form in AddNew mode can change a control from display to data
entry, which is my objective, but I want to work around the extra command
button and required click to implement. My objective is to use another event
to trigger the control to readiness to receive the entry of new data. The
unbound condition is for the new data entry. Many thanks.
 
D

Douglas J Steele

AFAIK, you can change the control's Control Source programmatically.

To unbind a text box, use

Me.MyTextBox.ControlSource = vbNullString

To bind it to a field, use

Me.MyTextBox.ControlSource = "MyField"

I have to say, though, that I find this a very unusual requirement. What's
the point of entering data into unbound fields? Don't you want the data
stored in the table?
 
G

Guest

Thanks Doug,

Tested as provided, and works exactly as needed. Your question is certainly
valid and the sign of a thinking man. In a moderately complex form where
phone conversation detail is recorded, the new data is entered into unbound
controls to be later update when values have been entered into all required
controls. The "Update" control button moves all unbounded control values
into a table and re-displays the newly updated data. The latest completed
call always displays at the top of a continuous display form.

The application is in a crisis center. A key issue with this form design
and function was that it open to fully display all detail from the most
recent call to or from an individual, and readily display detail on any and
all historic calls. New data entry is initiated once typing commences in any
unbouded control. The "Update" button does many things beyond updating the
table and requerying the underlying data for the form.

Hope this explanation helps you understand.

Your great help to me and many others is always appreciated.

Cheers
 

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