J
James
Many Thanks to responding to my post...
I would like to clarify a few things..
When I have my form which is having the issue of showing
all the records its record source is an SQL query where as
all the rest are Tables? Would this have anything to do
with my issue if so what do I need to do to stop it from
happening?
Also do you have any ideas on my second question in the
fact of how to rectify it as when I search for something
it does nothing..
Any suggestions?
Thanks again
James
I would like to clarify a few things..
When I have my form which is having the issue of showing
all the records its record source is an SQL query where as
all the rest are Tables? Would this have anything to do
with my issue if so what do I need to do to stop it from
happening?
Also do you have any ideas on my second question in the
fact of how to rectify it as when I search for something
it does nothing..
Any suggestions?
Thanks again
James
-----Original Message-----
Dear James
Normally a form is bound to a set of records, be it a
table or query, ie when the form is opened it displays the
records relating to the record set on which it is bound.
An unbound form does not have any records behind it (An
example of this would be a menu/swithcboard form)
Using the example of designing a new unbound form from
scratch, you would place an unbound form on the control by
selecting the type of control (be it a text box, combo
box, radio button, etc) from the tool box. until you set
the record source from the control's properties, it will
remain unbound.
What the code in your post is doing, is opening a form for
the user to enter details in. Once the text boxes have
been filled in, the user clicks on a button. by doing so
the button calls the code and stores the infomation taken
from the 3 text boxes.
I hope this makes things a little bit clearer
Kind regards
Paul-----Original Message-----
Right ok I have been given the following code to stop all
the records being produced on the form when opened and I
would like to know what exactly the explinaton below means:
I'd approach your first issue with an 'Unbound' form andcontrols. That means the form doesn't have
a 'RecordSource', and the controls don't have
a 'ControlSource'. Enter your information into the
unbound fields and click on a command button to write the
info to your table. Use something similar to the
following as the On_Click event sub procedure...
Private Sub CommandButtonName_Click()
Dim rst as DAO.Recordset
Set rst = CurrentDb.OpenRecordset(dbOpenDynaset)
With rst
.AddNew
!Field1 = Me!1stControlName
!Field2 = Me!2ndControlName
!Field3 = Me!3rdControlName
.Update
End With
rst.Close
Set rst = Nothing
Me!1stControlName = Null
Me!2ndControlName = Null
Me!3rdControlName = Null
MsgBox "Record has been written."
End Sub
Right I will tell you about the set-up...
I am trying to create a Search form and I have three
subforms. I have a combo box whoch dependant on its value
opens the relevant subform. Now then one of the subforms
has the problem described above where as the other two do
not. So I have the subforms set-up so that everything is
disabled and when you put a tick in the chkbox it enables
the relevant field. so that then I search on that
particular field and then I click the search button which
has the following code:
FilterMe = "[id] > 0"DoCmd.ApplyFilter , FilterMeIf chkcisco1 Then FilterMe = FilterMe & " AND [Forname]
= " & cbocisco1
Thats an example of one of the combo boxes on one of the
subforms.
Any help would be greatly appreciated.
James