Ms access 2 querys for the same comboboxes

0

Good to all I'm programming a database and I would like to have a kind of 3 querys. I'll try to be as accurate as possible. I have 2 combo boxes that are interconnected, in this case I specifically make and model, and when I choose the brand, it only shows me the model as I wanted it, but in another form I have a situation that has given me a lot of headaches because there is not way to figure out how to do it.

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

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

    
asked by anonymous 01.07.2015 / 22:13

1 answer

0

SOLVED I discovered I can do the query. What I wanted was really what is in 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 make DLookup the various fields change to non-editable. I tried this code without success:

Me.Combinação65.AllowValueListEdits = False
    
02.07.2015 / 20:14