updating table data from form list box (1 Viewer)

wasim

Registered User.
Local time
Today, 14:43
Joined
Jun 10, 2016
Messages
19
I have issue with updating table data from form. Form is with list box. I want to update the table from below code:
Current db.execute "UPDATE POSITIONAPPLIED SET POSITIONAPPLIED.PEVALID = " & Me.EVALID _
& " WHERE (((POSITIONAPPLIED.POSITIONAPPLIEDID)= " & Me.lsthosp.Column(0, i) & ") And ((POSITIONAPPLIED.APPLICATIONID)= " & Me.lsthosp.Column(3, i) & "));", dbFailOnError

But it updates all the lines in the table. I want to update only the pertilcular line where the above conditon meets. Why this updates all the records in the table?

Please help me out.

wasim
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:43
Joined
Feb 19, 2013
Messages
16,618
think you need to show the whole code - the 'i' implies a loop of some sort
 

wasim

Registered User.
Local time
Today, 14:43
Joined
Jun 10, 2016
Messages
19
Hi,

if i remove' i' it gives me error message. Is there some otherway to update the table ?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:43
Joined
Feb 19, 2013
Messages
16,618
I wasn't suggesting you remove the I.

I'm suggesting there is more code - how does I get assigned a value for example.

You are asking for help, but leaving us guessing where the problem is because you have only shown where you think the problem is.

If you are not prepared to show the whole code for the event that the one line you have provided is triggered, then I regret I cannot help
 

Users who are viewing this thread

Top Bottom