VB isn't the hardest thing to learn.
In access you are actually using VBA. The cut down version.
And the code compeletion is a godsend.
Normally when you create a text box is design view you get the text box (called Textxx) and a label (labelxx).
I leave the label as it is as you won't be referencing it. The text box however is easiest to rename txtYYYY (i.e. txtName txtDate and so on).
Create a command button (call it cmdSubmit for instance).
When you have created these (simplest one this) you can switch to the code vie, vie -> code.
So lets say you have a text box called txtName, the command button called cmdSubmit and a table called tblData. And yes I do name my stuff in this way, I also call my forms frm and reports rpt.
In code view you should see two drop down boxes next to each other. In the left hand box select cmdSubmit.
This automaticly produces a little bit of code for the OnClick() function which you will see appear.
Now in here you need to begin by checking that data has been input. Easiest way
Code:
If IsNull(txtName) Then
MsgBox "Sorry Data has not been input"
txtName.SetFocus
End Sub
End If
Note that no Else is needed as we exit the function if it is true, the rest of the code will only occur if we IsNull returns false, i.e. there is something in the box.
Next we have two ways of doing this. I'll show you the query way now and if you want to I'll post the other, slightly more complex, but more flair, way of doing it.
Now we have to add a query into the database, call it qryLookup.
What we'll do is open the query, set the query to look for all records in which the Field "Name" is like (i.e. contains the term from txtName)
Code:
'note I am not 100% sure about this, I have not used VBA that long and have left my 'code at work
Dim strSQL as String
strSQL = "Select * from tblData WHERE Name Like " & txtName & ";"
CurrentDB.QueryDefs("qryLookup").SQL = strSQL
IIRC this takes the query and changes it.
Now create another form, frmResults, and create a largeish list box in it.
Set the listbox to have its lookup as a query, set that query to qryLookup.
Now back in the original form you have, at the bottom of the last bit of code we want to close the current form and open the form with the newly defined query.
Code:
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.OpenForm "frmResults"
Then you should have the End Sub function.
As I say I am not perfect onm this, but that is one of the easiest methods. I personally prefer the other method which I'll write up for you on Monday.