Ms access 2 querys for the same comboboxes

Asked

Viewed 45 times

0

Good to all I am programming a database and I would like to have a kind of 3 querys. I’ll try to be as precise as I can. I have 2 combination boxes that are interconnected, in this specific case Make and Model, and when I choose the brand only shows me the model as I wanted, but on another form I have a situation that has given me quite a headache because there is no way to figure out how to do it.

form insert car In this form I insert the internal number of the vehicle and use the query I mentioned above.

form insert part In this I would like to do something different. Having a text box in which I enter the car’s internal number and access will automatically fetch the data I entered in the table in the previous form but if this number is not present I wanted you to do what you do in the form insert car. If you want to leave free the same works but if you want to do a search of the data of the entered cars I lose the query that makes me the brand and the model are interconnected.... I can provide the project if I help someone.

1 answer

0

RESOLVED I figured I could do the query. What I really wanted was this code.

'UPDATE DE MARCA, MODELO, MOTORIZAÇÃO, ANO INICIO, ANO FIM, DATA MATRICULA, NUMERO DE PORTAS E COMBUSTIVEL QUANDO VFV EXISTIR
Private Sub Comando713_Click()
If Not IsNull(Me!Texto689.Value) Then
    Me!Combinação65.Value = DLookup("[MARCA]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me!Combinação69.Value = DLookup("[MODELO]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me!Texto73.Value = DLookup("[ANO INICIAL]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me!Texto75.Value = DLookup("[ANO FINAL]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me!Texto137.Value = DLookup("[MOTORIZAÇÃO]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me!Combinação611.Value = DLookup("[NUMERO DE PORTAS]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me!Texto137.Value = DLookup("[MOTORIZAÇÃO]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me!Texto445.Value = DLookup("[CODIGO MOTOR]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me!Combinação435.Value = DLookup("[COMBUSTIVEL]", "[CONSULTA DE VFV INSERIR PEÇAS]")
    Me.Texto696.SetFocus
    Me.Combinação65.AllowValueListEdits = False
End If
End Sub

Now I needed that when I do Dlookup the various fields change to non-edited. I tried this code unsuccessfully:

Me.Combinação65.AllowValueListEdits = False

Browser other questions tagged

You are not signed in. Login or sign up in order to post.