Sam Summers
Registered User.
- Local time
- Today, 08:23
- Joined
- Sep 17, 2001
- Messages
- 939
Hi everyone,
I have been on this thing on and off for months now and it is so close but due to my uselessness and plain stupidity i just cannot get this last bit working!!!
Obviously i am as usual missing something but i feel i am just chasing errors around???????
I send entered data from an input form to this unbound form:
When i click on the first button (Btn1) i have this code:
You will see commented out code that i couldnt get working.
I have also been trying these queries below but even though they insert the type and other details from the input form - nothing puts the position no. in the position field of the table 'Item'.
I am just totally confused now so if anyone can help me or something then it would be amazing!
I have been on this thing on and off for months now and it is so close but due to my uselessness and plain stupidity i just cannot get this last bit working!!!
Obviously i am as usual missing something but i feel i am just chasing errors around???????
I send entered data from an input form to this unbound form:
When i click on the first button (Btn1) i have this code:
Code:
Private Sub Btn1_Click()
Me.Position.SetFocus
Me.Position.Text = "1"
Me.Extinguisher.SetFocus
Me.Position1 = Me.Extinguisher.Text
DoCmd.OpenQuery "MessLocationSet"
If Me.Extinguisher.Text = "Wet Chemical" Then
Me.Btn1.BackColor = RGB(0, 201, 87)
Else
If Me.Extinguisher.Text = "Water" Then
Me.Btn1.BackColor = RGB(255, 0, 0)
Else
If Me.Extinguisher.Text = "Foam" Then
Me.Btn1.BackColor = RGB(255, 228, 181)
Else
If Me.Extinguisher.Text = "CO2" Then
Me.Btn1.BackColor = RGB(0, 0, 0)
Else
If Me.Extinguisher.Text = "Powder" Then
Me.Btn1.BackColor = RGB(30, 144, 255)
Else
End If
End If
End If
End If
End If
'DoCmd.OpenQuery "MessUpdate"
'DoCmd.Close , , acSaveYes
'Dim FireExtinguisherDB As DAO.Database
'Dim Item As DAO.Recordset
'
' Set FireExtinguisherDB = CurrentDb
' Set Item = FireExtinguisherDB.OpenRecordset("Item")
'
' Item.AddNew
' Item!Position = "1"
' Item!DescriptionRef = Me.TypeRef
'' .
'' . ' Set remaining fields.
'' .
'
' Item.Update
End Sub
You will see commented out code that i couldnt get working.
I have also been trying these queries below but even though they insert the type and other details from the input form - nothing puts the position no. in the position field of the table 'Item'.
I am just totally confused now so if anyone can help me or something then it would be amazing!