|
-
Jul 5th, 2000, 01:08 PM
#1
Thread Starter
New Member
I have a form for table1 with PK and a form for table2 with FK. I pull records from table1 and onClick want fields in form for table2 to populate based on PK from table1. Both forms are MDIChild.
(Frm1)
Private Sub cmdCourses_Click()
progField = txtField(1)
MyRs.Close
strSQL = "SELECT * FROM table2 WHERE FK = '" & progField & "'"
Set MyRs = New ADODB.Recordset
MyRs.Open strSQL, MyConn, adOpenDynamic, adLockOptimistic
frmTable2.Text1.Text = MyRs.Fields(0).Value
frmTable2.Show
End Sub
Can anyone help, I'm brain dead 2day
-
Jul 5th, 2000, 11:23 PM
#2
Guru
try using:
progField = CSTR(txtField(1))
sometimes if a number is in a text box, you won't get the correct value of the value in the field
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|