continuous form

  • Thread starter klp via AccessMonster.com
  • Start date
K

klp via AccessMonster.com

Can you, in a continuous form(which is also my subform), default it to
automatically show 10 records if you will. For example:

When the testing screen opens, someone will be entering in new data. In the
subform I want it to default to show 10 lines, numbering 1-10, so they can go
in and start entering in data. See Below:

1_________________
2_________________
3_________________
4_________________
5_________________
6_________________
7_________________
8_________________
9_________________
10________________

I want to try to avoid doing separate fields for each of these lines for
reporting purposes. Is there any way to do this on a continuous form?

thanks!
 
A

Al Campagna

klp,
-------------------------------
From Albert Kallal....
You can put the follwing code in the sub form:

Function Rpos(vId As Variant) As Long
Rpos = 0
If IsNull(vId) = False Then
Me.RecordsetClone.FindFirst "id = " & vId
If Me.RecordsetClone.NoMatch = False Then
Rpos = Me.RecordsetClone.AbsolutePosition + 1
End If
End If
End Function

Then, you can put a un-bound text box in the continoues form,and

=(rpos([id]))

**The above assumes you have a key field called id. It also assumes dao.

Albert D. Kallal (MVP)
------------------------------------ OR ---------------
http://www.lebans.com/rownumber.htm
-------------------------------------
 
K

klp via AccessMonster.com

So I can just go ahead and put this function behind the subform? Sorry a
little new and some of the coding. Then I just did Dim Dao as recordset. Is
that correct?

Thanks for your patience w/ me.

Kim

Al said:
klp,
-------------------------------
From Albert Kallal....
You can put the follwing code in the sub form:

Function Rpos(vId As Variant) As Long
Rpos = 0
If IsNull(vId) = False Then
Me.RecordsetClone.FindFirst "id = " & vId
If Me.RecordsetClone.NoMatch = False Then
Rpos = Me.RecordsetClone.AbsolutePosition + 1
End If
End If
End Function

Then, you can put a un-bound text box in the continoues form,and

=(rpos([id]))

**The above assumes you have a key field called id. It also assumes dao.

Albert D. Kallal (MVP)
------------------------------------ OR ---------------
http://www.lebans.com/rownumber.htm
-------------------------------------
Can you, in a continuous form(which is also my subform), default it to
automatically show 10 records if you will. For example:
[quoted text clipped - 18 lines]
 
A

Al Campagna

Yes, that should do it... It's Function in the Form Module.

I haven't used this code myself, but I see it posted quite often in regards to this
question.
You might want to do a Google Groups search against "public.access" "numbering"
"continous" (or variants of that), and take a look at the resources available for this
function.

--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


klp via AccessMonster.com said:
So I can just go ahead and put this function behind the subform? Sorry a
little new and some of the coding. Then I just did Dim Dao as recordset. Is
that correct?

Thanks for your patience w/ me.

Kim

Al said:
klp,
-------------------------------
From Albert Kallal....
You can put the follwing code in the sub form:

Function Rpos(vId As Variant) As Long
Rpos = 0
If IsNull(vId) = False Then
Me.RecordsetClone.FindFirst "id = " & vId
If Me.RecordsetClone.NoMatch = False Then
Rpos = Me.RecordsetClone.AbsolutePosition + 1
End If
End If
End Function

Then, you can put a un-bound text box in the continoues form,and

=(rpos([id]))

**The above assumes you have a key field called id. It also assumes dao.

Albert D. Kallal (MVP)
------------------------------------ OR ---------------
http://www.lebans.com/rownumber.htm
-------------------------------------
Can you, in a continuous form(which is also my subform), default it to
automatically show 10 records if you will. For example:
[quoted text clipped - 18 lines]
 
K

klp via AccessMonster.com

I will look into the google groups. Thanks.

One more thing. Now I know this is to auto-number when there are records
already in the db correct? Because I want it to have 10 blank records in
there(autonumbered 1-10) and then all they have to do is put in the dates of
the failures. Is that possible?

Al said:
Yes, that should do it... It's Function in the Form Module.

I haven't used this code myself, but I see it posted quite often in regards to this
question.
You might want to do a Google Groups search against "public.access" "numbering"
"continous" (or variants of that), and take a look at the resources available for this
function.
So I can just go ahead and put this function behind the subform? Sorry a
little new and some of the coding. Then I just did Dim Dao as recordset. Is
[quoted text clipped - 34 lines]
 
A

Al Campagna

This is to number existing subform records. I can not say that it would work given the
scenario you have described... I can only suggest that you try it.

It is do-able, but I question the necessity.

I think attempting to create 10 new records for every instance sounds pretty odd.. If
your continuous subform is the Many in a One to Many realtionship, you should just let the
records build up by normal entry. I would start with that, and add the "create 10
records" coding when everything is nailed down and working.
If you don't have a lot of experience with Access, and VBA coding, you could be in for
problems.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions



klp via AccessMonster.com said:
I will look into the google groups. Thanks.

One more thing. Now I know this is to auto-number when there are records
already in the db correct? Because I want it to have 10 blank records in
there(autonumbered 1-10) and then all they have to do is put in the dates of
the failures. Is that possible?

Al said:
Yes, that should do it... It's Function in the Form Module.

I haven't used this code myself, but I see it posted quite often in regards to this
question.
You might want to do a Google Groups search against "public.access" "numbering"
"continous" (or variants of that), and take a look at the resources available for this
function.
So I can just go ahead and put this function behind the subform? Sorry a
little new and some of the coding. Then I just did Dim Dao as recordset. Is
[quoted text clipped - 34 lines]
 
K

klp via AccessMonster.com

I agree w/ what you are saying. Yes my subform is the many. Currently I have
it set up as a standard continuous form. This is a testing DB. They have to
test 10 tabs and they want to enter them in numerical order. See not all tabs
fail in their order. So they could put in 1,2,4,6 then the next day tabs 3,5,
7,-10 fail. I guess I can just sort Ascending by the Tab. I do do the coding
for what you suggested, but is it going to be worth it w/o problems?

Al said:
This is to number existing subform records. I can not say that it would work given the
scenario you have described... I can only suggest that you try it.

It is do-able, but I question the necessity.

I think attempting to create 10 new records for every instance sounds pretty odd.. If
your continuous subform is the Many in a One to Many realtionship, you should just let the
records build up by normal entry. I would start with that, and add the "create 10
records" coding when everything is nailed down and working.
If you don't have a lot of experience with Access, and VBA coding, you could be in for
problems.
I will look into the google groups. Thanks.
[quoted text clipped - 16 lines]
 
A

Al Campagna

klp,
If I understand correctly, and I'm not totally sure that I do...

I had a similar situation. Client needed, according to the length of the product, to
test values at intervals along that length. I placed a button in the subform called
Generate Records, and... with an empty subform, this would generate all the measurement
points the tester would have to enter data for, according to the product specs. According
to the length... this might require 10 to 60 records. This sounds like what your doing
with your 10 records...
Why don't you develop the code that would (making sure the subform was empty) go to the
first new rceord, enter a 1 in the count field (ex.TestNumber), go to the next record,
enter a 2, then 3 etc... until 10 records had been generated. Users would be required to
enter 3 test results on the #3 record, 7 data on the #7, etc...
Since it's only 10 records, a very "mecahnical" coding for... (aircode)
For Ctr = 1 to 10
GoTo New
TestNumber = Ctr
Next Ctr
would do the trick.

Or, a DAO loop would do as well. But, with only 10 small recs I wouldn't think there
wouldn't be any noticeable difference.
And... each test point should also have it's own unique ID.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

klp via AccessMonster.com said:
I agree w/ what you are saying. Yes my subform is the many. Currently I have
it set up as a standard continuous form. This is a testing DB. They have to
test 10 tabs and they want to enter them in numerical order. See not all tabs
fail in their order. So they could put in 1,2,4,6 then the next day tabs 3,5,
7,-10 fail. I guess I can just sort Ascending by the Tab. I do do the coding
for what you suggested, but is it going to be worth it w/o problems?

Al said:
This is to number existing subform records. I can not say that it would work given the
scenario you have described... I can only suggest that you try it.

It is do-able, but I question the necessity.

I think attempting to create 10 new records for every instance sounds pretty odd..
If
your continuous subform is the Many in a One to Many realtionship, you should just let
the
records build up by normal entry. I would start with that, and add the "create 10
records" coding when everything is nailed down and working.
If you don't have a lot of experience with Access, and VBA coding, you could be in
for
problems.
I will look into the google groups. Thanks.
[quoted text clipped - 16 lines]
 

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