Array of Forms

workmad3

***** Slob
Local time
Today, 20:52
Joined
Jul 15, 2005
Messages
375
Ok. here is the problem. Im creating an interface for access, and I would like to create an array to store forms in. This is so I can use the array with an integer as a stack. This will then let me use the stack to store the order that forms were opened in so I can then undo them in order as the user closes them, allowing them to just close a form to get to the last one they opened.

Any hints would be appreciated, currently got some code like this which doesnt work

Code:
Dim LastForm(1 To 10) As Forms
Dim currentForm As Integer

Public Sub SetLastForm(fr As Forms)
   currentForm = currentForm + 1
   LastForm(currentForm) = fr
End Sub

Public Sub initialise()
   currentForm = 0
End Sub

Public Function GetLastForm() As Forms
   GetLastForm = LastForm(currentForm)
   currentForm = currentForm - 1
End Function
 
The forms(i) is an array of openned forms and in the order they were opened... Why create your own?

Reinvent the wheel?
 
heh :) mainly cos i didnt know the forms(i) existed.

thanks
 
Remember tho, Forms() is zero based as in all arrays in access....

This means that the first form will be Forms(0)

Good luck...
 
heh. decided against it for current interface... however as its just a prototype will prob redesign it using this when i do the final version(i got it working nice and easy using a select statement, and it needs a bit of an overhaul to change it now, but redesigning it in a week or so will be easier)
 

Users who are viewing this thread

Back
Top Bottom