I would think using a recordset should work. There may be a better way, but I'm pretty sure the recordset method could work. Here is a couple idea's:
First, if it will always be the last record updated, then you can just do as above, b/c when the record is updated from the first form, all other forms (assuming you open one first to update the record, and the others later), then the last record updated will be that record. So the rs.MoveLast would place focus on the last record. If you don't have a terribly high number of controls on each form, then you could show the values on the form like this:
Private Sub Form_Load()
Call LoadCurrentRecord
cmbCombo1 = rs.Fields("FieldName1")
txtText2 = rs.Fields("FieldName2")
cmbCombo3 = rs.Fields("FieldName3")
End Sub
Something like that.. or, if you want to declare Public variables, you could Dim public variables to match each of the fields that will show in the forms.. I have one form where I Dim String variables, then set the string variables equal to the controls on the form, move to next record, and set the controls equal to the string variables. So, with multiple forms, you could do a similar method by using Public variables, kind of like this maybe...
Code:
'In a module:
Public strField1 As String
Public strField2 As String
Public strField3 As String
'In the first form:
Private Sub Form_Unload()
strField1 = cmbCombo1
strField2 = txtText2
strField3 = cmbCombo3
End Sub
'In other forms which will pull same data
Private Sub Form_Load()
cmbCombo1 = strField1
cmbText2 = strField2
cmbCombo3 = strField3
End Sub
'... and so on
Of course, this is assuming you use the same fields for each table, but I would assume you are using different fields, which is why I would think using a recordset would be the best way to go. If need be to be more specific, you could use an If Then statement to pull just the selected record.. Add in something like this:
If rs.Fields("Field1") = cmbCombo1 Then
~run code
End If
Of course, you would need to put that within a loop which loops through the recordset until it finds the code, then possibly an Exit statement within the If statement to exit the loop once the record is found.. like this, possibly:
rs.MoveFirst
Do While Not rs.EOF
If rs.Fields("Field1") = cmbCombo1 Then
'run code here for setting values for your particular
'form (whichever fields need to be called for this form..
Exit DoLoop (not sure of exact format/term usage here)
Else
rs.MoveNext
End If
Wend
Hope it works out for you, or if anyone else posts a better idea, I'm all ears myself, as I want to continue learning as well.. [BIGEARS]
Stephen
![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV