Please help I am a student doing this project for my HNC and I am completely stuck.
I have designed a database with one table and one form, the form has a number of comboboxes which show various items and their prices (though their default value is ‘none’). The comboboxes are based on different queries from the table, and each selection decides (via an ‘if’ statement) which query is used as a source for the subsequent combobox, then I hit calculate and I get a total. The trouble is that when I reset the comboboxes, any of them which may have had their source 'changed’ at run time now revert to a null rather than the ‘none’ which I want.
The code for my reset button is:
Private Sub lblreset_Click()
DoEvents
txtsubtot = ""
txtvat = ""
txttot = ""
'resets address box
Textcust1.SetFocus
Textcust1.Text = ""
Textcust2.SetFocus
Textcust2.Text = ""
Textcust3.SetFocus
Textcust3.Text = ""
Textcust4.SetFocus
Textcust4.Text = ""
Textcust5.SetFocus
Textcust5.Text = ""
'resets combo boxes
cmbcase = Empty
cmbmother = Empty
cmbmem = Empty
cmbhdd = Empty
cmbvid = Empty
cmbsnd = Empty
cmbcd = Empty
cmbmon = Empty
cmbmse = Empty
cmbkybrd = Empty
cmbmodem = Empty
cmbproc = Empty
cmbsoftware = Empty
cmbwarranty = Empty
cmbcdrw = Empty
Textcust1.SetFocus
DoEvents
End Sub
I have designed a database with one table and one form, the form has a number of comboboxes which show various items and their prices (though their default value is ‘none’). The comboboxes are based on different queries from the table, and each selection decides (via an ‘if’ statement) which query is used as a source for the subsequent combobox, then I hit calculate and I get a total. The trouble is that when I reset the comboboxes, any of them which may have had their source 'changed’ at run time now revert to a null rather than the ‘none’ which I want.
The code for my reset button is:
Private Sub lblreset_Click()
DoEvents
txtsubtot = ""
txtvat = ""
txttot = ""
'resets address box
Textcust1.SetFocus
Textcust1.Text = ""
Textcust2.SetFocus
Textcust2.Text = ""
Textcust3.SetFocus
Textcust3.Text = ""
Textcust4.SetFocus
Textcust4.Text = ""
Textcust5.SetFocus
Textcust5.Text = ""
'resets combo boxes
cmbcase = Empty
cmbmother = Empty
cmbmem = Empty
cmbhdd = Empty
cmbvid = Empty
cmbsnd = Empty
cmbcd = Empty
cmbmon = Empty
cmbmse = Empty
cmbkybrd = Empty
cmbmodem = Empty
cmbproc = Empty
cmbsoftware = Empty
cmbwarranty = Empty
cmbcdrw = Empty
Textcust1.SetFocus
DoEvents
End Sub