Develop a Microsoft Access database with the table(s) necessary to hold any 5 st
ID: 3736583 • Letter: D
Question
Develop a Microsoft Access database with the table(s) necessary to hold any 5 states of the United States of America, their capitals and a graphic picture of the appropriate state flag or state tree or flower. Using VBA, construct a multiple choice quiz which randomly selects a state and asks the user to select the correct capital of the randomly selected state. If the user answers incorrectly, the screen should display a message with the word ‘INCORRECT’ with the state name, the correct capital and the correct matching graphic. If the user answers correctly, display an appropriate message.
Explanation / Answer
private sub()
dim loaf as variant
dim fifa as variant
dim ras as range
set ras=range("a1:a4")
loaf=inputbox(prompt:"enter one random number between 1 to 4 ")
range("b1").value=loaf
sofa=swtich(range("b1").value=1,"virginia",range("b1").value=2,"texas",range("b1").value=3,"ohio",range("b1").value=4,"New york")
fifa=inputbox(prompt:"enter the city name of ", default: sofa )
range("c1").value=loaf
if(range("b1").value=1 and range("c1").value like "*Richmond") then
msgbox"city matched"
else
msgbox" state mismatch"
if(range("b1").value=2 and range("c1").value like "*Austin") then
msgbox"city matched"
else
msgbox" state mismatch"
if(range("b1").value=3 and range("c1").value like "*Columbus") then
msgbox"city matched"
else
msgbox" state mismatch"
if(range("b1").value=4 and range("c1").value like "*albany") then
msgbox"city matched"
else
msgbox" state mismatch"
end if
end sub
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.