By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

Client Form How To Transfer ClientID to Appointments

P: 11
Good Day,

I am a newbie to access. Currently running 2003 version. I have created a clients table with a command button "Schedule Estimate" which goes to my client appointments form. I am wondering if there is a way to transfer the ClientID over to the schedule estimate form when I click "Schedule Estimate". On the Client Appointments form I have ClientID, EstimateID, EstimateDate, EstimateTime. Any help is appreciated.

Thank You,

Steve
Feb 21 '08 #1
Share this Question
Share on Google+
3 Replies


mshmyob
Expert 100+
P: 904
If you have your relations setup properly then ClientID is a foreign key in your appointment table.

Create a Main form / subform and your key will be updated properly.

That is only 1 way - there are many others. You can pass it via code if you have 2 forms open

Say frmClient and frmAppointment

Expand|Select|Wrap|Line Numbers
  1. 'pass from frmClient to frmAppointment
  2. ' both forms must be open
  3. Forms!frmAppointment.ClientID = Me.txtClientID.Value
  4.  
Good Day,

I am a newbie to access. Currently running 2003 version. I have created a clients table with a command button "Schedule Estimate" which goes to my client appointments form. I am wondering if there is a way to transfer the ClientID over to the schedule estimate form when I click "Schedule Estimate". On the Client Appointments form I have ClientID, EstimateID, EstimateDate, EstimateTime. Any help is appreciated.

Thank You,

Steve
Feb 21 '08 #2

P: 11
Expand|Select|Wrap|Line Numbers
  1. Private Sub ScheduleEstimate_Click()
  2. On Error GoTo Err_ScheduleEstimate_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "Client Estimate Appointments"
  8.  
  9.     stLinkCriteria = "[ClientID]=" & "'" & Me![ClientID] & "'"
  10.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  11.  
  12. Exit_ScheduleEstimate_Click:
  13.     Exit Sub
  14.  
  15. Err_ScheduleEstimate_Click:
  16.     MsgBox Err.Description
  17.     Resume Exit_ScheduleEstimate_Click
  18.  
  19. End Sub
here is my code, if you can help with this that will help me out. I am learning therefore want to see how it would be done. Thank You.
Feb 21 '08 #3

mshmyob
Expert 100+
P: 904
Assuming you have no Errors just add the following after your OpenForm command.

Of course change the control names to match yours....

Expand|Select|Wrap|Line Numbers
  1. Forms!frmForm2.txtClientIDReceive.value = Me.txtClientIDFrom.Value
  2.  
Feb 22 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.