I think the piece your missing is that the query can with in the control be saved as a SQL statement which will allow you to use it a little different than the original version.
On the Row source property of the control click on th elispe instead of the pull down. Pick the queery you want to...
In that case do this...
if isnull(me!field1) or me!field1 = "" then
cancel = 1
end if
if isnull(me!field2) or me!field2 = "" then
cancel = 1
end if
if isnull(me!field3) or me!field3 = "" then
cancel = 1
end if
If cancel = 1 then
msgbox "Need more data"
ELSE
docmd.close
end...
Normally this is caused when the control is drop on the form not on the tabcontrol. Cut them and repaste back on the tabcontrol. The main body of the tab will gray when it is a good time to drop them. This can happens when a control is moved on to a tab control or if the txt control is dropped...
On the form unload event add the following code...
if isnull(me!field1) or me!field1 = "" then
cancel = 1
end if
if isnull(me!field2) or me!field2 = "" then
cancel = 1
end if
if isnull(me!field3) or me!field3 = "" then
cancel = 1
end if
<<<END CODE>>>
Remember to change...
The table you built is called a linking table. Build your form off the linking table using combo boxes and/or list boxes to fil in the inforamtion you need. If you need to add a new patient then you pop up a secondary from that allows entry of theat info. when you close the secondary form it...
Create a child table that not only include the unique id of the parent but an identifier from what parent table it came from. them when it becomes time to delete you delete the parent record and the child record where the parent table identifier is equal to the parent table AND the unique id is...
Great start you have taken the time to think out the problem and define you tables, most people believe it or not seam to forget this step.
Using a unique number as the unique id for each of the first three table will work and there is nothing wrong with that at all. In fact it is normally the...
I just cut and pasted your code into a test DB renamed two of the tables to your names changed the names of a couple of fields in the tables and the code run with out a hitch.
The reference is correct it is the only optional one I have selected as well.
I am at a real loss. For the record...
Calculate your results into a query then run a crosstab query on the results. One last thing to remember with a little though you can union crosstab queries to each other giving totals or other information that might be of interest.
Good Luck
Two questions...
Does the SQL statement run as a query ok?
Is it possible that one of the variable names is being used somewhere else as a different daata type?
Post the entire code and indicate what line is causing the error.
In order to accomplish what you want you need to understand normalization. Normalization is the breaking up of data into separate units of like data which is then stored in separate tables. Fully normalized table sin you scenario would consist of three tables
Tables:
Names Table - Holds all the...
Based on the unique client identifier create a recordset that goes something like this...
function myfun(client_No as int)
Dim rs as recordset
dim strSQL as string
strSQL = "Select top 1 t.sesionNo" _
& " From tbl_mytable t" _
& " Where Unique_Client =...
try this...
=Sum([Indemnity_Paid])/nz([Grand_Indemnity_Paid],0)*100
although I'm not sure. As I read your formula you are multiplying Grand_Idemnity by 100 and then deviding the result by Indemnity_paid if that is correct this might be a better solution...