sonia
10-26-2004, 05:14 AM
hi all hope all is well
i am using access 2000 .
I have two forms, form1 and form2. form1 has a command button which opens up form2 and shows to values of two textboxes which are on form1 in form2 in separte textboxes.
I would like to add a new record and then after the values of form1 are added to form2...
my code which i am using is below
Public bkTranInid As String ' public variable doing an instantiation of the form2 in from1
Dim bktranIN As Form_frmbookTranIn
Set bktranIN = New Form_frmbookTranIn
Dim str As String
str = "SELECT stock.id, stock.bookname, bookTranIn.bookreceivedid" & _
"FROM stock INNER JOIN bookTranIn ON stock.id = bookTranIn.bookreceivedid "
Dim rs As Recordset
Set rs = Recordset()
Dim db As Database
Set db = CurrentDb()
DoCmd.OpenForm "frmbooktranin", acNormal
bktranIN.bookreceivedid = rs.Fields("id").Value
bktranIN.txtbkname = rs.Fields("bookname").Value
i am using access 2000 .
I have two forms, form1 and form2. form1 has a command button which opens up form2 and shows to values of two textboxes which are on form1 in form2 in separte textboxes.
I would like to add a new record and then after the values of form1 are added to form2...
my code which i am using is below
Public bkTranInid As String ' public variable doing an instantiation of the form2 in from1
Dim bktranIN As Form_frmbookTranIn
Set bktranIN = New Form_frmbookTranIn
Dim str As String
str = "SELECT stock.id, stock.bookname, bookTranIn.bookreceivedid" & _
"FROM stock INNER JOIN bookTranIn ON stock.id = bookTranIn.bookreceivedid "
Dim rs As Recordset
Set rs = Recordset()
Dim db As Database
Set db = CurrentDb()
DoCmd.OpenForm "frmbooktranin", acNormal
bktranIN.bookreceivedid = rs.Fields("id").Value
bktranIN.txtbkname = rs.Fields("bookname").Value