Melissa
So that last step opens a report. What data set is the report based
on?
If
that data for the report comes from a query, post the SQL statement of
that
query.
--
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Jeff
No problem at all...
Ok, for the cmdButton "Add Job" on the switchboard:
Private sub Command14_Click()
On Error GoTo Err_Command14_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Jobs"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
Exit_Command14_Click:
Exit Sub
Err_Command14_Click:
MsgBox Err.Description
Resume Exit_Command14_click
End Sub
_________
Then once "Jobs" form opens, - Click on cmdButton "AddClientDetails"
Macro
is as follows:
OpenForm -
FormName - Clients
FilterName - leftblank
WhereCondition - leftblank
DataMode - Add
WindowMode - Dialog
____________________
Then i close the "clients" form using the X
THen upon returning to form "Jobs", refresh button macro as follows:
Requery
ControlName - VehicleRegNo
Requery
ControlName - ClientId
_____________________________________
Then after filling in other fields...click on cmdButton "InvoiceNow"
code:
Private Sub Command448_Click()
On Error GoTo Err_Command448_Click
Dim stDocName As String
stDocName = "JobsQuery"
DoCmd.OpenReport stDocName, acPreview
Me.HasPrinted = True
Exit_Command448_Click:
Exit Sub
Err_Command448_Click:
MsgBox Err.Description
Resume Exit_Command448_Click
End Sub
________________________________
Hope I did this right (not so clued up with code)
THank you very much
Melissa
message
Melissa
Thanks for the additional information.
Now I need to ask for more!<g>
Someone can put ANY code behind a button click, so telling us about the
buttons on the forms won't really help diagnose why the
button-clicks
are
doing something unexpected.
Please provide the code itself, in addition to the user interface
you've
already described.
--
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Jeff,
My apologies for not providing enough information....
On my switchboard, I have a cmdButton "Add Job", which then opens
my
"Jobs"
form in add mode.
Then on my "jobs" form, I have a cmdButton which opens my "Clients"
form
in
add mode. I then type in my new clients details in the "clients"
form,
and
then close the "clients" form, and return to the "Jobs" form
I then click on the cmdButton "Refresh" on my "Jobs" form, and then I
find
the client i just created in my Clients' combo box.
After selecting the client from the combo box on the "jobs" form, i
continue
to fill in the other fields on the "jobs" form. Then after that, I
have
a
cmdButton - "Invoice Now", which opens the report "Invoice".
When i
open
the invoice, I have the same "JobNo" showing twice, each with the same
clients information.
This is how i realised that the clients are being added twice
I also tried to add a new client directly from the "clients" form
by
opening
it throught the objects window, and the same happens. Each client is
duplicated in the "Clients' table.
I hope I have provided the correct information
Thank you kindly
Melissa
message
Melissa
We aren't there. We don't know how your "Clients" form is
processing
what
you give it. We don't know how you are "adding a new client" to
that
form.
More specific description may lead to more specific suggestions.
For instance, is there any code running 'behind' that form? How are
you
adding...?
--
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Hi there
Everytime I add a new client in my "Clients" form. It adds that
client
twice. I can see the duplicates in my Combo box on another
form,
the
each
client is listed twice? I have the "indexed / yes (no duplicates)
set
in
my
Clients table.
What could be doing this?
Thank you kindly
Melissa