Ok, I want to create a function, called CountRows. (It's going to work like mysql_num_rows, but VBA has nothing to do that
) I'm new to working in VBA, so I can conceptualise things, it's just syntax/getting it into what VBA wants is the difficulty.
The function will be called with strPurchaseOrderRef, a string variable that contains an order number.
I want the function to take that variable, go to the table in my database called tblHWPurchasing, and count how many records have that order number in the field called MasterOrderRef. Then pass back an integer value equalling the number of times that row occurs.
i'm guessing it would involve an SQL count query, but I can't seem to make it work.
Can anyone help?