2 quickies (1 Viewer)

tru-

Registered User.
Local time
Yesterday, 22:03
Joined
Jan 29, 2006
Messages
18
At the bottom of the form where the navigation buttons are it'll say 1 of 8 records, how can I get this into a form? (I want to have some text saying Viewing 1 of 8 Products).

Also how can I copy a record from one subform to another? The first subform is like a catalogue of items, the second is a temporary list which items can be added to and cleared when needed (each subform have their own tables).

Cheers :)
 

Tsango

Registered User.
Local time
Today, 06:03
Joined
Mar 31, 2006
Messages
64
tru- said:
At the bottom of the form where the navigation buttons are it'll say 1 of 8 records, how can I get this into a form? (I want to have some text saying Viewing 1 of 8 Products).

Also how can I copy a record from one subform to another? The first subform is like a catalogue of items, the second is a temporary list which items can be added to and cleared when needed (each subform have their own tables).

Cheers :)


You could just count the records in the record set

NumberOfRecords = Table.RecordCount

then create changes the caption properties of a label to read

label.caption = "Viewing 1 to " & NumberOfRecords & " Products"

Example:

Dim cnn As ADODB.Connection
Dim rstTable As New ADODB.Recordset
Dim NumberOfRecords as Integer

Set cnn = CurrentProject.Connection

rstTable.Open "table", cnn, adOpenStatic, adCmdTable
NumberOfRecords = rstTable.RecordCount
Label.Caption = "Viewing 1 to " & NumberOfRecords & " Products"

This code copuld be placed on the OnOpen event or similar
 

ghudson

Registered User.
Local time
Today, 01:03
Joined
Jun 8, 2002
Messages
6,194
Searching the forum is a great way to discover and learn the answers to your Access programming questions.

Record X of Y
 

tru-

Registered User.
Local time
Yesterday, 22:03
Joined
Jan 29, 2006
Messages
18
I did but didnt find anything so posted, I always search first :)
thanks
 

tru-

Registered User.
Local time
Yesterday, 22:03
Joined
Jan 29, 2006
Messages
18
I've tried using that example on a subform, when opened on its own as a form it works but when I try to open it when its as a subform I get debug come up, highlighting RecordsetClone.MoveLast & RecordsetClone.MoveFirst.
Any solution?
 

ghudson

Registered User.
Local time
Today, 01:03
Joined
Jun 8, 2002
Messages
6,194
You have to also install the Record X of Y stuff [code, text box, etc.] in the subform just like you did in the parent form.
 

Tsango

Registered User.
Local time
Today, 06:03
Joined
Mar 31, 2006
Messages
64
ghudson said:
You have to also install the Record X of Y stuff [code, text box, etc.] in the subform just like you did in the parent form.

:) :) :) :) :) :) :) :)
 

Users who are viewing this thread

Top Bottom