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

Changing values

P: n/a
Hi..
i have the foll: code in my VBA script. eg: at the moment if my count
is 2. it calls a query and updates my database by adding two records
and puttin a unique id in my ID field and takes the value of text5 and
updates ASSET name in my NAME field in the database and updates my
LEVEL field in the database to E. Now i need the LEVEL (E) to change
to (V).

so my objective is. if count is two. there should be two records for
each LEVEL.

SO IF COUNT IS TWO

example: ID NAME LEVEL

1 EDUCATION E
2 EDUCATION E
3 EDUCATION V
4 EDUCATION V
Dim count As Integer
Dim qd As QueryDef
Dim j As Integer
j = 0
count = Text2

While j <count

Set qd = CurrentDb.QueryDefs("company")
qd.Parameters("parFld1") = Text5
qd.Parameters("parFld2") = "E"
qd.Execute

j = j + 1

Wend

DoCmd.Close

Exit_Command8_Click:
Exit Sub

Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click

End Sub

Aug 16 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.