Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2006, 12:05 AM
x taol
Guest
 
Posts: n/a
Default i'm so tired



Private Sub cod_AfterUpdate()
Dim rst As DAO.Recordset
q = "select fld1,fld2,fld3 from tbl where code_fld='" & cod & "'"
Set rst = CurrentDb.OpenRecordset(q)
If rst.EOF = -1 Then Exit Sub
ary = rst.GetRows()
fld1_ctl = ary(0, 0)
fld2_ctl = ary(1, 0)
fld3_ctl = ary(2, 0)
rst.Close
End Sub

the upper source is not work.
namely, if i press the enter button after input, the 3 fields is all
fulled the same. i want to fill one record only.
currently, i work in form of datasheet type.


*** Sent via Developersdex http://www.developersdex.com ***
  #2  
Old November 13th, 2006, 01:05 AM
AccessVandal via AccessMonster.com
Guest
 
Posts: n/a
Default Re: i'm so tired

What is the error message? Stop at which line?

Add this below "Dim rst as DAO.Recordset"

Dim q As String

And what is "ary"? An Array?
Quote:
>x taol wrote:
>Private Sub cod_AfterUpdate()
>Dim rst As DAO.Recordset
>q = "select fld1,fld2,fld3 from tbl where code_fld='" & cod & "'"
>Set rst = CurrentDb.OpenRecordset(q)
>If rst.EOF = -1 Then Exit Sub
>ary = rst.GetRows()
>fld1_ctl = ary(0, 0)
>fld2_ctl = ary(1, 0)
>fld3_ctl = ary(2, 0)
>rst.Close
>End Sub
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

  #3  
Old November 13th, 2006, 01:15 AM
x taol
Guest
 
Posts: n/a
Default Re: i'm so tired



no error message.
and "Option Explicit" is not.

currently, i made the form(datasheet type) of query based.
curiously, form of table based is no problem, but query based is problem
which all records of the specific fields(fld1,fld2,fld3) are changed the
same value.

*** Sent via Developersdex http://www.developersdex.com ***
  #4  
Old November 13th, 2006, 03:35 AM
AccessVandal via AccessMonster.com
Guest
 
Posts: n/a
Default Re: i'm so tired

What is the query like? Check your query, it might be a non-edit.
Quote:
>no error message.
>and "Option Explicit" is not.
>
>currently, i made the form(datasheet type) of query based.
>curiously, form of table based is no problem, but query based is problem
>which all records of the specific fields(fld1,fld2,fld3) are changed the
>same value.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

  #5  
Old November 13th, 2006, 09:05 AM
Terry Kreft
Guest
 
Posts: n/a
Default Re: i'm so tired

I take it that the three controls are unbound as you will see this behaviour
in that case.



--

Terry Kreft


"x taol" <tomi3440@yahoo.comwrote in message
news:4557bb24$0$10298$815e3792@news.qwest.net...
Quote:
>
>
Private Sub cod_AfterUpdate()
Dim rst As DAO.Recordset
q = "select fld1,fld2,fld3 from tbl where code_fld='" & cod & "'"
Set rst = CurrentDb.OpenRecordset(q)
If rst.EOF = -1 Then Exit Sub
ary = rst.GetRows()
fld1_ctl = ary(0, 0)
fld2_ctl = ary(1, 0)
fld3_ctl = ary(2, 0)
rst.Close
End Sub
>
the upper source is not work.
namely, if i press the enter button after input, the 3 fields is all
fulled the same. i want to fill one record only.
currently, i work in form of datasheet type.
>
>
*** Sent via Developersdex http://www.developersdex.com ***

 

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