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

i'm so tired

P: n/a


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 ***
Nov 13 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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?
>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

Nov 13 '06 #2

P: n/a


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 ***
Nov 13 '06 #3

P: n/a
What is the query like? Check your query, it might be a non-edit.
>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

Nov 13 '06 #4

P: n/a
I take it that the three controls are unbound as you will see this behaviour
in that case.

--

Terry Kreft
"x taol" <to******@yahoo.comwrote in message
news:45***********************@news.qwest.net...
>

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 ***

Nov 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.