Use the value of a variable within the string of a query

1

Usually when I assign a variable to a constant I would do it in the following way.

Dim user As Variant
user = InputBox("Ingresa tu usuario de la PC")

I am connecting data with Visual Basic and Access. In one part of the query I declare the following line

MBEW.addWherePredicate ("BWTAR = '1234'")

Could someone guide me to assign the variable I entered in the input box to the BWTAR field?

I tried doing it like that but it's wrong

MBEW.addWherePredicate ("BWTAR = user")
    
asked by hdan7 06.03.2017 в 19:08
source

1 answer

1

I found the form, with a concatenated one. In case someone comes to go through the same thing

MBEW.addWherePredicate ("BWTAR = '" & user & "'")
    
answered by 06.03.2017 в 19:18