unbound continuous forms

D

Derek

I am trying to populate an unbound continuous form but it does not seem to
work. I have setup a generic form to test this and have set up an unbound
field named child. I have set the form to continuous view and inserted this
code on open

Private Sub Form_Open(Cancel As Integer)
Dim test As String

test = "SELECT tbl00ProjectsHiearchyLevel2.Level2 AS Child FROM
tbl00ProjectsHiearchyLevel2"
Forms!tt.RecordSource = test

End Sub


When the form opens it correctly shows me the child field box 3 times (all
the data in this recordset) but it those not bring in the actual values. The
field box is blank
 
A

Albert D.Kallal

Well, it is good to note that as soon as you throw in and set the
recordsouce, the form is now bound. (so, in point you are not using a
un-bound form...but it does start out that way).

I would take your sql, save it as a query. Now, bind the form to that query.
lets now move to design mode of the form. Now, view the field list, and drag
the field onto the form. Switch to view mode..and make sure it works. Now,
save the form..and then REMOVE the datasouce. Your code should now work.
Likely somewhere along the way, you got the datasouce for the CONTROL set
wrong. So, check the name of the control, and further, check what field that
control is bound to
 
T

tina

forms don't have fields; tables have fields. forms have controls, which may
be unbound, or bound to a field in a bound form's underlying recordset.

it's not enough to bind the form to a recordset at runtime, you have to bind
the control to a field in the recordset also, as

Me!MyControl.ControlSource = "Child"

substitute the correct name of the control, of course.

hth
 

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