Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2005, 12:57 AM
Aravind
Guest
 
Posts: n/a
Default pushing data from unbound text boxes

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.
  #2  
Old November 13th, 2005, 12:57 AM
rkc
Guest
 
Posts: n/a
Default Re: pushing data from unbound text boxes


"Aravind" <solaris_nite@hotmail.com> wrote in message
news:6174ca57.0406180038.6a2ba7b6@posting.google.c om...[color=blue]
> 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
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-[/color]

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



  #3  
Old November 13th, 2005, 01:00 AM
Aravind
Guest
 
Posts: n/a
Default Re: pushing data from unbound text boxes

"rkc" <rkc@yabba.dabba.do.rochester.rr.bomb> wrote in message news:<YQCAc.354462$M3.24589@twister.nyroc.rr.com>. ..[color=blue]
> "Aravind" <solaris_nite@hotmail.com> wrote in message
> news:6174ca57.0406180038.6a2ba7b6@posting.google.c om...[color=green]
> > 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
> >
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-[/color]
>
> 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[/color]

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.
  #4  
Old November 13th, 2005, 01:00 AM
rkc
Guest
 
Posts: n/a
Default Re: pushing data from unbound text boxes


"Aravind" <solaris_nite@hotmail.com> wrote in message
news:6174ca57.0406201857.40348ae6@posting.google.c om...[color=blue]
> "rkc" <rkc@yabba.dabba.do.rochester.rr.bomb> wrote in message[/color]
news:<YQCAc.354462$M3.24589@twister.nyroc.rr.com>. ..[color=blue][color=green]
> > "Aravind" <solaris_nite@hotmail.com> wrote in message
> > news:6174ca57.0406180038.6a2ba7b6@posting.google.c om...[color=darkred]
> > > 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
> > >
> > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-[/color]
> >
> > 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[/color]
>
> 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.[/color]

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







  #5  
Old November 13th, 2005, 01:16 AM
Aravind
Guest
 
Posts: n/a
Default Re: pushing data from unbound text boxes

"rkc" <rkc@yabba.dabba.do.rochester.rr.bomb> wrote in message news:<oJsBc.102938$j24.29296@twister.nyroc.rr.com> ...[color=blue]
> "Aravind" <solaris_nite@hotmail.com> wrote in message
> news:6174ca57.0406201857.40348ae6@posting.google.c om...[color=green]
> > "rkc" <rkc@yabba.dabba.do.rochester.rr.bomb> wrote in message[/color]
> news:<YQCAc.354462$M3.24589@twister.nyroc.rr.com>. ..[color=green][color=darkred]
> > > "Aravind" <solaris_nite@hotmail.com> wrote in message
> > > news:6174ca57.0406180038.6a2ba7b6@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[/color]
> >
> > 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.[/color]
>
> 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[/color]

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.
  #6  
Old November 13th, 2005, 01:16 AM
rkc
Guest
 
Posts: n/a
Default Re: pushing data from unbound text boxes

[color=blue][color=green]
> > 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[/color]
>
> 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.[/color]

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?







  #7  
Old November 13th, 2005, 01:18 AM
Aravind
Guest
 
Posts: n/a
Default Re: pushing data from unbound text boxes

"rkc" <rkc@yabba.dabba.do.rochester.rr.bomb> wrote in message news:<AEOBc.106897$j24.66911@twister.nyroc.rr.com> ...[color=blue][color=green][color=darkred]
> > > 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[/color]
> >
> > 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.[/color]
>
> 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?[/color]

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.
  #8  
Old November 13th, 2005, 01:18 AM
rkc
Guest
 
Posts: n/a
Default Re: pushing data from unbound text boxes


"Aravind" <solaris_nite@hotmail.com> wrote in message
news:6174ca57.0406221754.7688df8b@posting.google.c om...[color=blue]
> "rkc" <rkc@yabba.dabba.do.rochester.rr.bomb> wrote in message[/color]
news:<AEOBc.106897$j24.66911@twister.nyroc.rr.com> ...[color=blue][color=green][color=darkred]
> > > > 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[/color][/color][/color]
error:[color=blue][color=green][color=darkred]
> > >
> > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > > Run-time error '3348':
> > > Can't add record(s); join key of table 'history' not in recordset
> > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > >
> > > What does it mean? Thanks.[/color]
> >
> > 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[/color][/color]
about[color=blue][color=green]
> > 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?[/color]
>
> 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.[/color]

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.





 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles