Open form, show first record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a very basic problem that I cannot seem to fix.

I want to open a form and display (only a few fields) the first record in
the table. Then, after clicking the NEXT button, I want to dispaly (on
another form) only a few more fields in the same record (the first record in
the table).

I've tried setting the Data Entry property to No and still, the form opens
with a blank record. Also, I've tried "DoCmd.GoToRecord , , acFirst" at the
form Load, but it STILL opens to a blank record.

I've checked the table and I am sure that there is only one record in the
table, which is the record I want to display.

What am I doing wrong?
 
RatherBeeHome said:
I have a very basic problem that I cannot seem to fix.

I want to open a form and display (only a few fields) the first
record in the table. Then, after clicking the NEXT button, I want to
dispaly (on another form) only a few more fields in the same record
(the first record in the table).

I've tried setting the Data Entry property to No and still, the form
opens with a blank record. Also, I've tried "DoCmd.GoToRecord , ,
acFirst" at the form Load, but it STILL opens to a blank record.

I've checked the table and I am sure that there is only one record in
the table, which is the record I want to display.

What am I doing wrong?

What is your code to open the second form?
 
Rick,

Here is the code to open the second form:

Me.Visible = False
DoCmd.OpenForm "frm_sip_2"

I took another look at my form and I found that the text boxes are unbound.
I had to design it this way because of data entry problems. There are 6
forms in all that the user enters data with. At the end of the 6th form, I
have the following code:

Set rs = DBEngine(0)(0).OpenRecordset("tbl_information", dbOpenTable,
dbAppendOnly)
rs.AddNew
rs.Fields("id") = Forms!frm_sip_1!id

rs.Update
rs.Close
Set rs = Nothing

I still want all forms to open to the first record in the "tbl_information"
table.
 
RatherBeeHome said:
Rick,

Here is the code to open the second form:

Me.Visible = False
DoCmd.OpenForm "frm_sip_2"

I took another look at my form and I found that the text boxes are
unbound. I had to design it this way because of data entry problems.
There are 6 forms in all that the user enters data with. At the end
of the 6th form, I have the following code:

Set rs = DBEngine(0)(0).OpenRecordset("tbl_information", dbOpenTable,
dbAppendOnly)
rs.AddNew
rs.Fields("id") = Forms!frm_sip_1!id

rs.Update
rs.Close
Set rs = Nothing

I still want all forms to open to the first record in the
"tbl_information" table.

Well, unbound TextBoxes aren't going to show squat unless you write some
code to populate them. That is what unbound means. If you use unbound
controls then there is no reason to use bound forms since what record the
form is "positioned" at is meaningless considering the way you are adding
the data with a Recordset.

Sounds like you are almost certainly doing this "the hard way".
 
Back
Top