MadeCurler
enthusiastic pensioner
- Local time
- Today, 02:33
- Joined
- Dec 6, 2007
- Messages
- 49
I'm very new to VBA and don't want to look an idiot in the open forum but I'm studying alone from books and for "fun" and it sometimes gets very frustrating when I can't find it on the web. I'm covering "debugging" at the moment and looking at how to use the "immediate" window. I understand how to use it to test "functions" by passing approriate arguments but how do I test this "Select Case" sub?
Sub UpdateRegionName(pForm As Object)
Select Case pForm.[RegionNumber]
Case "1"
pForm.[RegionName] = "Aberdeenshire Morayshire and Royal Deeside"
Case "2"
pForm.[RegionName] = "Ayrshire South West Scotland and Scottish Borders"
Case "3"
pForm.[RegionName] = "Inverness-shire and Cairngorms National Park"
Case "4"
pForm.[RegionName] = "Loch Lomond Glasgow Edinburgh and the Lothians"
Case "5"
pForm.[RegionName] = "Lochaber Western Highlands Argyll and Bute"
Case "6"
pForm.[RegionName] = "Perthshire Stirlingshire Angus and Fife"
Case "7"
pForm.[RegionName] = "Scottish Islands"
Case "8"
pForm.[RegionName] = "Sutherland Caithness and Ross-shire"
End Select
Debug.Print pForm; [RegionName]
End Sub
Sub UpdateRegionName(pForm As Object)
Select Case pForm.[RegionNumber]
Case "1"
pForm.[RegionName] = "Aberdeenshire Morayshire and Royal Deeside"
Case "2"
pForm.[RegionName] = "Ayrshire South West Scotland and Scottish Borders"
Case "3"
pForm.[RegionName] = "Inverness-shire and Cairngorms National Park"
Case "4"
pForm.[RegionName] = "Loch Lomond Glasgow Edinburgh and the Lothians"
Case "5"
pForm.[RegionName] = "Lochaber Western Highlands Argyll and Bute"
Case "6"
pForm.[RegionName] = "Perthshire Stirlingshire Angus and Fife"
Case "7"
pForm.[RegionName] = "Scottish Islands"
Case "8"
pForm.[RegionName] = "Sutherland Caithness and Ross-shire"
End Select
Debug.Print pForm; [RegionName]
End Sub