Learn Forms

A

Amul

I need to have a database connection thru' codings.
I will be using one combo which may have 4 fields from one table, only the
keyfield will be stored to another table others just display on the form.
Filter is by a selected date then selected value from combo box from another
table.
If value not found then insert mode if found then update mode.
Please guide me to do this.
 
A

Amul

No - I don't want to add a new item to the combo box.

Actual scenario:

I have two tables.

1) Customer Lists : Parent Table with primary key

2) Daily Transaction : Child table.

My Form will have:

1) Date Field (usually today's date)
2) Combo box having the values from table-1
3) Customer name and other details (read only) by selecting combo.
4) Transactions should be added, matching should be the date +
custid, if possible to be added a grid.

If date and custid exists then values should be updated (sometimes +
some -)

If date and custid doesn't exists then a new record should be created
in table-2

Finally a report based selecting (From Date - Todate), sum by custid +
date.
Page wise total and a last page with full total with summary.

Please advice me to do this in a quite easy way.

TIA
 
A

Albert D. Kallal

You don't need to write any code.

You simply build a main form based on the customer table.

you then add a sub-form based on the child table.

when you navigate to a customer, you will see the list of child records. at
that point, you can either


a) edit existing child records
or
b) add a new child record.


The above is likely the best approach, and is how you model a one to many
relationships without without any code.

it not clear at what level your VBA coding skills are. You *can* write a
bunch of VBA code to accomplish your goals, but the above many very well be
a better alternative, and also one that takes no code at all....
 
A

Amul

Thanks for Responding me,

I can be addressed as a good programmer in VBA.

I use to write codings in FoxPro 2.0 for Lan in DOS environment.

Now I am developing some, small applications in Visual FoxPro 9.0 and trying
the same in Access.

My Daily transactions table will be having "nob" => number of bills. based
on a date + custid basis.

I will be having

[date field] [custid - combo] [custname] [cust ... other values]

all the above are unbound.

[amount field] => Unbound also not in the table.

[nob] [billTotal] => not editable, bound to dlybill table.

[+] [-] => command buttons to add values.

when I select the value in combo I need to search values in transactions
tablefiltered by date+custid, if values are there then to bring into [nob]
and [billotal]

if there are no values - then I will be inserting a new value in to the
trans.table.

the amount entered in [amount field] will be used to insert if it is a new
record or it will updated to [nob] & [billTotal].

[nob] =>sum of number of bills to one custid + bill date

[billTotal] => sum of the amount(s) entered for custid + bill date.

Please guide me to do this in a easiest way.
 
Top