Add record and update List

D

Dan @BCBS

This message has two questions:
When I click my command button (Code Below) I need it to open the form in
ADD mode but still linked to the Parent form as it is doing now.
Second, that Parent form has a list box that needs to be updated when the
record is added.

Suggestions??

This is the command button form:
Private Sub cmdProvADD_Click()
On Error GoTo Err_cmdProvADD_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "f_ProvDetail"

stLinkCriteria = "[ICNNo]=" & "'" & Me![ICNNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdProvADD_Click:
Exit Sub

Err_cmdProvADD_Click:
MsgBox Err.Description
Resume Exit_cmdProvADD_Click

End Sub
 
J

Jeff Boyce

Dan

You've described a "how" you are trying to do this).

Everything starts with the data in Access. Please describe a bit more about
the "what" and "why" (what will having a "record ... added" and "list...
updated" allow you to do?).

"Parent" forms in Access have sub. You mention "open the form... but still
linked to the Parent form". I don't understand.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
D

Dan @BCBS

Parent form (f_Main) is all members information about claims they submit.
Subform (f_ProvDetail) is a form to enter Provider demographics.
Listbox (f_ProvSub) is on the Parent form and shows a datasheet list of only
provider name and number.

Currently, my list box shows a list of providers assigned to each
claim/parent form. I am trying to add a command button to open the subform
(f_ProvDetail) in ADD-mode to add additional providers assigned to that case.
Then I need the list box to refresh and show all the providers...

So, how can I make the code below open the from in ADD-Mode then refresh the
list box?

Eventually, I also want to add an edit button.






Jeff Boyce said:
Dan

You've described a "how" you are trying to do this).

Everything starts with the data in Access. Please describe a bit more about
the "what" and "why" (what will having a "record ... added" and "list...
updated" allow you to do?).

"Parent" forms in Access have sub. You mention "open the form... but still
linked to the Parent form". I don't understand.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Dan @BCBS said:
This message has two questions:
When I click my command button (Code Below) I need it to open the form in
ADD mode but still linked to the Parent form as it is doing now.
Second, that Parent form has a list box that needs to be updated when the
record is added.

Suggestions??

This is the command button form:
Private Sub cmdProvADD_Click()
On Error GoTo Err_cmdProvADD_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "f_ProvDetail"

stLinkCriteria = "[ICNNo]=" & "'" & Me![ICNNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdProvADD_Click:
Exit Sub

Err_cmdProvADD_Click:
MsgBox Err.Description
Resume Exit_cmdProvADD_Click

End Sub
 
J

Jeff Boyce

Dan

Let's see if I can paraphrase this...

You have a form (f_Main) you are using to display a member's information
(like, FirstName, PhoneNumber, ...?). Are you saying that a member can have
more than one claim? If so, where are you storing and where are you showing
this one-to-many relationship?

You have a form (f_ProvDetail) that's used for Provider demographics (what's
a Provider? what kind of demographics? and how are Providers related to
Members? Or are Providers related to Claims?

You have something you are calling a "Listbox" (f_ProvSub)... but in Access,
a listbox is a type of control that goes on a form, not a form in itself.

It sounds like you want to be able to add a new provider. One way to do
this would be to add a command button that goes to a new record in your
Provider subform. This doesn't change the form to ADD-mode, but does put
the cursor in a new record row.

Good luck!

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Dan @BCBS said:
Parent form (f_Main) is all members information about claims they submit.
Subform (f_ProvDetail) is a form to enter Provider demographics.
Listbox (f_ProvSub) is on the Parent form and shows a datasheet list of only
provider name and number.

Currently, my list box shows a list of providers assigned to each
claim/parent form. I am trying to add a command button to open the subform
(f_ProvDetail) in ADD-mode to add additional providers assigned to that case.
Then I need the list box to refresh and show all the providers...

So, how can I make the code below open the from in ADD-Mode then refresh the
list box?

Eventually, I also want to add an edit button.






Jeff Boyce said:
Dan

You've described a "how" you are trying to do this).

Everything starts with the data in Access. Please describe a bit more about
the "what" and "why" (what will having a "record ... added" and "list...
updated" allow you to do?).

"Parent" forms in Access have sub. You mention "open the form... but still
linked to the Parent form". I don't understand.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Dan @BCBS said:
This message has two questions:
When I click my command button (Code Below) I need it to open the form in
ADD mode but still linked to the Parent form as it is doing now.
Second, that Parent form has a list box that needs to be updated when the
record is added.

Suggestions??

This is the command button form:
Private Sub cmdProvADD_Click()
On Error GoTo Err_cmdProvADD_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "f_ProvDetail"

stLinkCriteria = "[ICNNo]=" & "'" & Me![ICNNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdProvADD_Click:
Exit Sub

Err_cmdProvADD_Click:
MsgBox Err.Description
Resume Exit_cmdProvADD_Click

End Sub
 
D

Dan @BCBS

Your paraphrase is not correct.
You are digging way deep into unnessary details..

I'm just trying to update the list box added on a form!

The form (f_Main) has a "Listbox" (f_ProvSub)... It also has command button.

Click the command button and it opens a form to add a record.

Here is the question:
All I want to do is update the "ListBox" to show the newly added record.

A little more detail - Let call the mainform "Customers" the command button
"ADD" and the list box "Orders".

Click the button, an order form comes up, close the order form and the list
box is update with that information.

The list box and already displays correct data I just can't get it to update
to display the newly entered data.






Jeff Boyce said:
Dan

Let's see if I can paraphrase this...

You have a form (f_Main) you are using to display a member's information
(like, FirstName, PhoneNumber, ...?). Are you saying that a member can have
more than one claim? If so, where are you storing and where are you showing
this one-to-many relationship?

You have a form (f_ProvDetail) that's used for Provider demographics (what's
a Provider? what kind of demographics? and how are Providers related to
Members? Or are Providers related to Claims?

You have something you are calling a "Listbox" (f_ProvSub)... but in Access,
a listbox is a type of control that goes on a form, not a form in itself.

It sounds like you want to be able to add a new provider. One way to do
this would be to add a command button that goes to a new record in your
Provider subform. This doesn't change the form to ADD-mode, but does put
the cursor in a new record row.

Good luck!

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Dan @BCBS said:
Parent form (f_Main) is all members information about claims they submit.
Subform (f_ProvDetail) is a form to enter Provider demographics.
Listbox (f_ProvSub) is on the Parent form and shows a datasheet list of only
provider name and number.

Currently, my list box shows a list of providers assigned to each
claim/parent form. I am trying to add a command button to open the subform
(f_ProvDetail) in ADD-mode to add additional providers assigned to that case.
Then I need the list box to refresh and show all the providers...

So, how can I make the code below open the from in ADD-Mode then refresh the
list box?

Eventually, I also want to add an edit button.






Jeff Boyce said:
Dan

You've described a "how" you are trying to do this).

Everything starts with the data in Access. Please describe a bit more about
the "what" and "why" (what will having a "record ... added" and "list...
updated" allow you to do?).

"Parent" forms in Access have sub. You mention "open the form... but still
linked to the Parent form". I don't understand.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

This message has two questions:
When I click my command button (Code Below) I need it to open the form in
ADD mode but still linked to the Parent form as it is doing now.
Second, that Parent form has a list box that needs to be updated when the
record is added.

Suggestions??

This is the command button form:
Private Sub cmdProvADD_Click()
On Error GoTo Err_cmdProvADD_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "f_ProvDetail"

stLinkCriteria = "[ICNNo]=" & "'" & Me![ICNNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdProvADD_Click:
Exit Sub

Err_cmdProvADD_Click:
MsgBox Err.Description
Resume Exit_cmdProvADD_Click

End Sub
 
J

Jeff Boyce

Perhaps "unnecessary" to you.

Unless I understand what you have and what you want to do, I can only offer
generalities.

Good luck!

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Dan @BCBS said:
Your paraphrase is not correct.
You are digging way deep into unnessary details..

I'm just trying to update the list box added on a form!

The form (f_Main) has a "Listbox" (f_ProvSub)... It also has command button.

Click the command button and it opens a form to add a record.

Here is the question:
All I want to do is update the "ListBox" to show the newly added record.

A little more detail - Let call the mainform "Customers" the command button
"ADD" and the list box "Orders".

Click the button, an order form comes up, close the order form and the list
box is update with that information.

The list box and already displays correct data I just can't get it to update
to display the newly entered data.






Jeff Boyce said:
Dan

Let's see if I can paraphrase this...

You have a form (f_Main) you are using to display a member's information
(like, FirstName, PhoneNumber, ...?). Are you saying that a member can have
more than one claim? If so, where are you storing and where are you showing
this one-to-many relationship?

You have a form (f_ProvDetail) that's used for Provider demographics (what's
a Provider? what kind of demographics? and how are Providers related to
Members? Or are Providers related to Claims?

You have something you are calling a "Listbox" (f_ProvSub)... but in Access,
a listbox is a type of control that goes on a form, not a form in itself.

It sounds like you want to be able to add a new provider. One way to do
this would be to add a command button that goes to a new record in your
Provider subform. This doesn't change the form to ADD-mode, but does put
the cursor in a new record row.

Good luck!

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Dan @BCBS said:
Parent form (f_Main) is all members information about claims they submit.
Subform (f_ProvDetail) is a form to enter Provider demographics.
Listbox (f_ProvSub) is on the Parent form and shows a datasheet list
of
only
provider name and number.

Currently, my list box shows a list of providers assigned to each
claim/parent form. I am trying to add a command button to open the subform
(f_ProvDetail) in ADD-mode to add additional providers assigned to
that
case.
Then I need the list box to refresh and show all the providers...

So, how can I make the code below open the from in ADD-Mode then
refresh
the
list box?

Eventually, I also want to add an edit button.






:

Dan

You've described a "how" you are trying to do this).

Everything starts with the data in Access. Please describe a bit
more
about
the "what" and "why" (what will having a "record ... added" and "list...
updated" allow you to do?).

"Parent" forms in Access have sub. You mention "open the form...
but
still
linked to the Parent form". I don't understand.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

This message has two questions:
When I click my command button (Code Below) I need it to open the
form
in
ADD mode but still linked to the Parent form as it is doing now.
Second, that Parent form has a list box that needs to be updated
when
the
record is added.

Suggestions??

This is the command button form:
Private Sub cmdProvADD_Click()
On Error GoTo Err_cmdProvADD_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "f_ProvDetail"

stLinkCriteria = "[ICNNo]=" & "'" & Me![ICNNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdProvADD_Click:
Exit Sub

Err_cmdProvADD_Click:
MsgBox Err.Description
Resume Exit_cmdProvADD_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top