By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,573 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,573 IT Pros & Developers. It's quick & easy.

pushing data from unbound text boxes

P: n/a
Hi folks.

I have 2 forms, frmBorrow and frmHistory

frmBorrow has an unbound multi-column combo box (cboMember) and 7
unbound text boxes (MemNo, MemName, MemIC, MemType, CourseFaculty,
Borrow, Due)

frmHistory has the following text boxes: MemName, Borrow, Due

When a record is selected from cboMember, the 1st 5 text boxes are
updated with the details in the combo box and the last 2 text boxes
are updated to display the current date and the date of the 7th day
from the current date.

I would like to push these data into the text boxes in frmHistory
(with the exception of MemNo, MemIC, MemType, and CourseFaculty). How
do I do this? I could only come up with the follwing codes but I do
not know how to use them:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Dim rst as RecordSet

rst.AddNew
rst.MemName = Me.txtMemName
rst.Borrow = Me.txtBorrow
rst.Due = Me.txtDue
rst.Update

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

I know I'm missing some coding but I cannot figure out what. Thank
you.
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
rkc

"Aravind" <so**********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
Hi folks.

I have 2 forms, frmBorrow and frmHistory

frmBorrow has an unbound multi-column combo box (cboMember) and 7
unbound text boxes (MemNo, MemName, MemIC, MemType, CourseFaculty,
Borrow, Due)

frmHistory has the following text boxes: MemName, Borrow, Due

When a record is selected from cboMember, the 1st 5 text boxes are
updated with the details in the combo box and the last 2 text boxes
are updated to display the current date and the date of the 7th day
from the current date.

I would like to push these data into the text boxes in frmHistory
(with the exception of MemNo, MemIC, MemType, and CourseFaculty). How
do I do this? I could only come up with the follwing codes but I do
not know how to use them:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Dim rst as RecordSet

rst.AddNew
rst.MemName = Me.txtMemName
rst.Borrow = Me.txtBorrow
rst.Due = Me.txtDue
rst.Update

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Are both forms open? If so whenever you want this to happen run
the follwing code from frmBorrow.

with forms("frmHistory")
!MemName = Me.txtMemName
!Borrow = Me.txtBorrow
!Due = Me.txtDue
end with

Nov 13 '05 #2

P: n/a
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message news:<YQ*******************@twister.nyroc.rr.com>. ..
"Aravind" <so**********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
Hi folks.

I have 2 forms, frmBorrow and frmHistory

frmBorrow has an unbound multi-column combo box (cboMember) and 7
unbound text boxes (MemNo, MemName, MemIC, MemType, CourseFaculty,
Borrow, Due)

frmHistory has the following text boxes: MemName, Borrow, Due

When a record is selected from cboMember, the 1st 5 text boxes are
updated with the details in the combo box and the last 2 text boxes
are updated to display the current date and the date of the 7th day
from the current date.

I would like to push these data into the text boxes in frmHistory
(with the exception of MemNo, MemIC, MemType, and CourseFaculty). How
do I do this? I could only come up with the follwing codes but I do
not know how to use them:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Dim rst as RecordSet

rst.AddNew
rst.MemName = Me.txtMemName
rst.Borrow = Me.txtBorrow
rst.Due = Me.txtDue
rst.Update

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Are both forms open? If so whenever you want this to happen run
the follwing code from frmBorrow.

with forms("frmHistory")
!MemName = Me.txtMemName
!Borrow = Me.txtBorrow
!Due = Me.txtDue
end with


Dear folks.
I neglected to mention that frmHistory is a continuos form, and that I
would like to push the data into a new record. So altho rkc's coding
works, it unfortunately modified the record to which the record
selector is pointed to. Sorry for the inconvenience.
Nov 13 '05 #3

P: n/a
rkc

"Aravind" <so**********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message

news:<YQ*******************@twister.nyroc.rr.com>. ..
"Aravind" <so**********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
I would like to push these data into the text boxes in frmHistory
(with the exception of MemNo, MemIC, MemType, and CourseFaculty). How
do I do this? I could only come up with the follwing codes but I do
not know how to use them:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Dim rst as RecordSet

rst.AddNew
rst.MemName = Me.txtMemName
rst.Borrow = Me.txtBorrow
rst.Due = Me.txtDue
rst.Update

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Are both forms open? If so whenever you want this to happen run
the follwing code from frmBorrow.

with forms("frmHistory")
!MemName = Me.txtMemName
!Borrow = Me.txtBorrow
!Due = Me.txtDue
end with


Dear folks.
I neglected to mention that frmHistory is a continuos form, and that I
would like to push the data into a new record. So altho rkc's coding
works, it unfortunately modified the record to which the record
selector is pointed to. Sorry for the inconvenience.


So you want to put the data in a new record? It would help if you
would just say so.

Again. Assuming both forms are open at the same time, run the
following code from frmBorrow whenever you want this to happen.

'go to a new record on frmHistory
'will raise an error if frmHistory is not open
DoCmd.GoToRecord acDataForm, "frmHistory", acNewRec

'insert the current data
with forms("frmHistory")
!MemName = Me.txtMemName
!Borrow = Me.txtBorrow
!Due = Me.txtDue
end with



Nov 13 '05 #4

P: n/a
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message news:<oJ********************@twister.nyroc.rr.com> ...
"Aravind" <so**********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message

news:<YQ*******************@twister.nyroc.rr.com>. ..
"Aravind" <so**********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
> I would like to push these data into the text boxes in frmHistory
> (with the exception of MemNo, MemIC, MemType, and CourseFaculty). How
> do I do this? I could only come up with the follwing codes but I do
> not know how to use them:
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Dim rst as RecordSet
>
> rst.AddNew
> rst.MemName = Me.txtMemName
> rst.Borrow = Me.txtBorrow
> rst.Due = Me.txtDue
> rst.Update
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Are both forms open? If so whenever you want this to happen run
the follwing code from frmBorrow.

with forms("frmHistory")
!MemName = Me.txtMemName
!Borrow = Me.txtBorrow
!Due = Me.txtDue
end with


Dear folks.
I neglected to mention that frmHistory is a continuos form, and that I
would like to push the data into a new record. So altho rkc's coding
works, it unfortunately modified the record to which the record
selector is pointed to. Sorry for the inconvenience.


So you want to put the data in a new record? It would help if you
would just say so.

Again. Assuming both forms are open at the same time, run the
following code from frmBorrow whenever you want this to happen.

'go to a new record on frmHistory
'will raise an error if frmHistory is not open
DoCmd.GoToRecord acDataForm, "frmHistory", acNewRec

'insert the current data
with forms("frmHistory")
!MemName = Me.txtMemName
!Borrow = Me.txtBorrow
!Due = Me.txtDue
end with


Thanks rkc, ur coding seems to work, but i'm getting the following error:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Run-time error '3348':
Can't add record(s); join key of table 'history' not in recordset
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

What does it mean? Thanks.
Nov 13 '05 #5

P: n/a
rkc
Again. Assuming both forms are open at the same time, run the
following code from frmBorrow whenever you want this to happen.

'go to a new record on frmHistory
'will raise an error if frmHistory is not open
DoCmd.GoToRecord acDataForm, "frmHistory", acNewRec

'insert the current data
with forms("frmHistory")
!MemName = Me.txtMemName
!Borrow = Me.txtBorrow
!Due = Me.txtDue
end with


Thanks rkc, ur coding seems to work, but i'm getting the following error:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Run-time error '3348':
Can't add record(s); join key of table 'history' not in recordset
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

What does it mean? Thanks.


Sounds to me like you still haven't told the whole story of what you are
doing.

We are talking about two different forms, right? We are not talking about
a Form with a subForm, Right?

Apparently the record source of your History form is not updateable.
Can you add a record manually inserting just the 3 fields you said you
were using?



Nov 13 '05 #6

P: n/a
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message news:<AE********************@twister.nyroc.rr.com> ...
Again. Assuming both forms are open at the same time, run the
following code from frmBorrow whenever you want this to happen.

'go to a new record on frmHistory
'will raise an error if frmHistory is not open
DoCmd.GoToRecord acDataForm, "frmHistory", acNewRec

'insert the current data
with forms("frmHistory")
!MemName = Me.txtMemName
!Borrow = Me.txtBorrow
!Due = Me.txtDue
end with


Thanks rkc, ur coding seems to work, but i'm getting the following error:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Run-time error '3348':
Can't add record(s); join key of table 'history' not in recordset
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

What does it mean? Thanks.


Sounds to me like you still haven't told the whole story of what you are
doing.

We are talking about two different forms, right? We are not talking about
a Form with a subForm, Right?

Apparently the record source of your History form is not updateable.
Can you add a record manually inserting just the 3 fields you said you
were using?


Yes, I'm using 2 different forms. I cannot manually add data into the
3 felds in frmHistory because frmHistory is primarily for display
purposes only. To manipulate the data in frmHistory, I have to use
frmBorrow. fmHistory is based on a query (qryHistory), which in turn
is based on the table History. frmBorrow is a stand-alone form i.e.
not based on any query or table. The data I am inserting (using
frmBorrow) comes from 3 combo boxes with multiple columns, each column
corresponding to a text box. The data in 3 of these text boxes are
pushed into the 3 fields in frmHistory. I realise these are not the
best ways to do things, but unfortunately it is required. I'm not sure
if this answers your questions. I'm sorry for any inconvenience.
Nov 13 '05 #7

P: n/a
rkc

"Aravind" <so**********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message

news:<AE********************@twister.nyroc.rr.com> ...
> Again. Assuming both forms are open at the same time, run the
> following code from frmBorrow whenever you want this to happen.
>
> 'go to a new record on frmHistory
> 'will raise an error if frmHistory is not open
> DoCmd.GoToRecord acDataForm, "frmHistory", acNewRec
>
> 'insert the current data
> with forms("frmHistory")
> !MemName = Me.txtMemName
> !Borrow = Me.txtBorrow
> !Due = Me.txtDue
> end with

Thanks rkc, ur coding seems to work, but i'm getting the following error:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Run-time error '3348':
Can't add record(s); join key of table 'history' not in recordset
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

What does it mean? Thanks.


Sounds to me like you still haven't told the whole story of what you are
doing.

We are talking about two different forms, right? We are not talking about a Form with a subForm, Right?

Apparently the record source of your History form is not updateable.
Can you add a record manually inserting just the 3 fields you said you
were using?


Yes, I'm using 2 different forms. I cannot manually add data into the
3 felds in frmHistory because frmHistory is primarily for display
purposes only. To manipulate the data in frmHistory, I have to use
frmBorrow. fmHistory is based on a query (qryHistory), which in turn
is based on the table History. frmBorrow is a stand-alone form i.e.
not based on any query or table. The data I am inserting (using
frmBorrow) comes from 3 combo boxes with multiple columns, each column
corresponding to a text box. The data in 3 of these text boxes are
pushed into the 3 fields in frmHistory. I realise these are not the
best ways to do things, but unfortunately it is required. I'm not sure
if this answers your questions. I'm sorry for any inconvenience.


You can't inconvenience me. Nobody is twisting my arm to sit and read
this stuff.

Unfortunately I have taken my best shot at trying to understand what
you are doing and why it isn't working.

Your latest post doesn' t give me any more to go on.

Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.