can't
As others mentioned there is several free editions of sql server.
The problem here is not using Oracle, SQL server, MySql, or the JET database
engine.
Access is not the database engine like Sql server. After you choose the
database engine of your choice, then you have to choose a set of
development tools with which to build the interface with.
You can't build forms with sql server. You can not build forms
with MySql, or with Oracle or <insert favorite database here>
So ms-access is a developers tool like vb, c++ etc and we should
try not to confuse it with a database engine.
In SQL I would do this as a stored procedure along the lines of
Right but then where is that data going to be feed to?
I can't seem to find a lookup function or a way
to make this simple VBA function (sorry, I am slow).
What I have is an Access Form that shows a record from table X
Ok so we already have data in the form. This is really a VERY different
question then that of a stored procedure.
I want
to populate other fields on that form from other tables based on the
record index of the form's record.
Are you saying table, or table(s). Again, a VERY different question if you
mean "table" or more then one table. You don't really populate controls on a
form. Forms have "controls" that are bound to the forms underlying
recordset. So it is the forms recordset (data source) that will change here.
Since the form is already bound to that table (or query), then we simply
"move" that recordset pointer to the required record in the table. Then
all the text boxes will display the correct information. Forms allow you to
edit ONE record at a time.
The simple way to do this is have users place their cursor in whatever text
box on the form and then hit ctrl-f.
If you want a "pick list" that the user chooses from (or enters a value)
then bring up the form in design mode, and drop a combo box onto the form
(use the forms wizards). The combo box wizard can build you a search combo
box.
The wizard will
write the code for you and then you can look at that code. So, that combo
box will allow you to select a value the table such as name, or company, or
whatever. In fact, when you build the combobox, have the 1st column as the
primary key (usually "ID"), and then the 2nd column can be the field you
want to search by, say Lastname, or perhaps even company.
When the user selects from that pick list, the form will then move to that
record, and all controls will populate/display the values for you.
In the current context here you really don't need a procedure to "look up" a
value.
If I missed your question and you you need to display values from other
tables
then I assuming those other tables are "related" to the main table in some
way?
If yes, then you use what is called a sub-form. So sub-forms allow you to
display other related tables. I explain sub-forms here:
http://www.members.shaw.ca/AlbertKallal/Articles/fog0000000005.html
Often we use continues forms to display "related" data from other tables.
Here is some screen shots of this concept:
http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm
Note how in the above we use "forms" to prompt the user, and there little
if anything to do with stored procedures.
Note that we don't have to write any code at all to "display" those related
table data in a form when we use a sub-form. The display and even updating
of "child" records is handled automatic for you when you use a sub-form.
So, to make a long story short, for your scenario a combo box that selects
the record and moves the form to that record to populate the contorls is
likly the best starting point here.