To handle records when you switch between them (first/last or any other) you can use the Form's Current event to carry out any specific actions.
For the subform to show the person associated with the current customer, you need to set the parent/child relationship in the subform control. By...
Hi
I looked at your forms again and see the problem. I put the combo box on the wrong field (CustomerId instead of PersonId). I have amended the customer form to rectify my error.
I have also added a table (tblType) to illustrate how you might use is as a reference. In this I have put three...
Bob fitz' comment yesterday would apply in this case. If you do need to differentiate between person types within the table, add a category field and give them unique values. However, that isn't strictly necessary, as each table will point to its own person record. The category becomes relevant...
I've had a look at your DB alongside the map you sent previously and I think your approach is inappropriate for what you want to do.
I would suggest your primary actions will be focused on the employee, customer and supplier tables, with the person table simply an input to them.
When you...
You might find DMax a better option.Field=DMax("SeqNbr","Claims","year=" & this.value)+1
SeqNbr and Claims are as you define them.
'year' here is the field name in the table which contains the year of interest. 'Field' is the where you want to put the value in your form.
OK, let's focus on those linked tables. Presumably there are other fields in them, so you need to add the FK (foreign key) to person as part of a complete new record for whichever table is the target?
You could try using DoCmd.OpenForm to open the relevant form for the required table, passing...
In the empty record, the field values are probably null, unless you explicitly populate them with zero in the table design.
The test
will always be true for a null field, so try it with the Nz function to assigne 0 when null.
Hi
I don't understand what you want to achieve from your combo box?
Is the form which contains the combo box bound to the person table and does that table get updated with the value you want from the selection?
What exactly do you mean by
Presumably you want the foreign key in each of the other...
Hi
I assume the two fields in the function are within the subform and that the #type appears in the last (empty) record?
If you put a test (IIf function) within the calculated field to make sure at least one of the fields is not null, that may fix the problem. For...
Hi
Your statementdoc.SaveAs ("Customers.doc")is the equivalent of doc.SaveAs ("C:\Users\ashfaque\Documents\Customers.doc")
You can make the path explicit by modifying the second instance with the path you want. If you use a string variable 'strPath' where you have the path you want, modify your...
In your original post, you said:
In your latest post you said:
My question is: What do you mean by 'the first record'? I assume you mean the query which links the tables, which would be a collection of physical records.
Would you post more details of the tables involved and the full syntax of...
Hi
I have tried various combinations of in-line methods to modify the query as you want, to no avail. The challenge is to exclude the WHERE clause for the 'All' case.
The best solution I have found (using your approach) is in the VBA AfterUpdate event code for the Option Group:Private Sub...
I'm struggling with this one, as I'm not entirely sure of the context. :confused:
From your description, I infer that you have a form with an OptionGroup which contains 3 option buttons. Your form contains two data fields (qryAFED.System, qryAFED.Status). The table data for 'qryAFED.Status'...
Not a lot to go on here!
Have a look at the Form properties under the Data tab. Check that 'Allow Additions' is set to 'Yes'.
Whilst you're in that tab, check the Record Source is as you expect (either pointing to the table directly, or invoking a query which references the table).
If that...
When using 'Me' in VBA in a form's module, it refers to that form object. You use the Form!<name> when making reference to another form object.
When a subform is present within the form, it will be contained within a SubForm control. That control has a Form property, so Me.SubForm.Form is the...
What do you do with the output of the Choose function? Is it part of a WHERE clause? If so, try putting the entire WHERE clause within an IIF function which tests for the 'All' condition and includes the WHERE only on the False condition.
If this doesn't help, please provide more detail about...