Next button not work (1 Viewer)

lovelrajesh

New member
Local time
Today, 13:51
Joined
Jun 10, 2018
Messages
12
Next button only next id. I wnat it next total record also which is in subform . i have one invoice form and sub form. Id and date field in invoice form and price qty are in subform INVOICE DATA.
 

bob fitz

AWF VIP
Local time
Today, 08:21
Joined
May 23, 2011
Messages
4,717
Why not create a next button on the invoice form
 

lovelrajesh

New member
Local time
Today, 13:51
Joined
Jun 10, 2018
Messages
12
I placed next button. It only next whole invoice id linked details which is in another sub form.
Problem i have 2 table 1 is main invoice id field table and another one is for invoice data table. Id is common . in this form invoice id =001 consist several records in subform like 1 2 3 4 . then invoice id =003 have another several record like 1. 2. 3. 4. 5. so on. I placed Next button also . but it only next invoice Id= 001 linked record like 1 2 3 4 also. Which i do not want. I want it only next maind invoice id . show total linked record in one click.
 
Last edited:

GinaWhipp

AWF VIP
Local time
Today, 04:21
Joined
Jun 21, 2011
Messages
5,901
Well, if I understand you correctly your Next button is not moving to the Next Invoice. If that is the case a couple of things...

1. Are you opening you Invoice Form (with Subform) filtered? If yes then it won't go to the next Invoice until you release that filter.

2. If you are not opening filtered then please post the code or macro steps you are suing to get to the next record.
 

bob fitz

AWF VIP
Local time
Today, 08:21
Joined
May 23, 2011
Messages
4,717
I placed next button. It only next whole invoice id linked details which is in another sub form.
Problem i have 2 table 1 is main invoice id field table and another one is for invoice data table. Id is common . in this form invoice id =001 consist several records in subform like 1 2 3 4 . then invoice id =003 have another several record like 1. 2. 3. 4. 5. so on. I placed Next button also . but it only next invoice Id= 001 linked record like 1 2 3 4 also. Which i do not want. I want it only next maind invoice id . show total linked record in one click.
Are you trying to tell us that you want a button on the SUBform that navigates records on the MAIN form?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:21
Joined
May 7, 2009
Messages
19,169
put your button on the Main Form not on the subform.
 

lovelrajesh

New member
Local time
Today, 13:51
Joined
Jun 10, 2018
Messages
12
Already my button is placed in main form.. How to release filter please tell. @Mr Bob. When press next it next sub form rcord not main form record. It next main form record after reaching last in subform record.
 

GinaWhipp

AWF VIP
Local time
Today, 04:21
Joined
Jun 21, 2011
Messages
5,901
Please post the code or macro steps you are using with the command button.
 

GinaWhipp

AWF VIP
Local time
Today, 04:21
Joined
Jun 21, 2011
Messages
5,901
I don't know from default as the default code works, so there must be something different. PLEASE post the VBA or macro steps you are using. Once the code is posted can happily make adjustments OR see why it's not working.

Should also mention that you need to make sure your Main Form and Subform are linked in order for them to work together.
 

lovelrajesh

New member
Local time
Today, 13:51
Joined
Jun 10, 2018
Messages
12
I have attached screenshot of form. please refer it.
VBA for next button is below:-


'------------------------------------------------------------
' NEXT_Click
'
'------------------------------------------------------------
Private Sub NEXT_Click()
On Error GoTo NEXT_Click_Err


On Error Resume Next
DoCmd.GoToRecord , "", acNext
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If


NEXT_Click_Exit:
Exit Sub

NEXT_Click_Err:
MsgBox Error$
Resume NEXT_Click_Exit

End Sub
 

GinaWhipp

AWF VIP
Local time
Today, 04:21
Joined
Jun 21, 2011
Messages
5,901
Well, let's replace what you have with the below. Copy\paste the part within the code tags between the Private Sub NEXT_Click() and End Sub


Private Sub NEXT_Click()
Code:
On Error GoTo SmartFormError
 
        DoCmd.RunCommand acCmdRecordsGoToNext
 
  
Exit_SmartFormError:
Exit Sub
 
SmartFormError:
    If Err = 2046 Or Err = 2501 Then
       Resume Next
    Else
       MsgBox Err.Description
       Resume Exit_SmartFormError
    End If
End Sub

Please be sure the command button is on the Main Form. Then confirm you have linked the Main Form and the Subform and test. When testing...

1. Does the Main Form go to the next record?
2. Did the accompanying Subform records also change? If not, please indicate the Link Master Fields and Link Child Fields.
3. If opening the Form from a command button on another Form please post the code for that command button.
 

lovelrajesh

New member
Local time
Today, 13:51
Joined
Jun 10, 2018
Messages
12
1 Yes main form having go to next button
i attached pic of form.
2. Accompanying Subform record also changing but i want to change only single invoice no with whole records.
 

Attachments

  • access prob.jpg
    access prob.jpg
    99.7 KB · Views: 55

lovelrajesh

New member
Local time
Today, 13:51
Joined
Jun 10, 2018
Messages
12
Please share your mail id i will send my access file. If you could send your mob no. to clear my prob. you can share.
 

isladogs

MVP / VIP
Local time
Today, 08:21
Joined
Jan 14, 2017
Messages
18,186
That's not how forums operate. Post a stripped down copy of your application removing anything not related to this issue and all confidential data. One or more people will then offer further advice to fix your problem.

Why does your form have two next buttons?
 

GinaWhipp

AWF VIP
Local time
Today, 04:21
Joined
Jun 21, 2011
Messages
5,901
Please share your mail id i will send my access file. If you could send your mob no. to clear my prob. you can share.

Wow, that took a bit. What have you being for the past 9 months? Was it working and then it stopped?

There is no database for me to share. As isaldogs just posted you needs to post a stripped down version of your file. If you are unable to do that then please poos *exactly* what you are doing. Because from the picture not sure what you want the Next button to do and which one you are referring to.
 

lovelrajesh

New member
Local time
Today, 13:51
Joined
Jun 10, 2018
Messages
12
I have placed next button again in form to check whether first one and second do same work.

Please let me know how to share my access file with you to show my problem.
 

Users who are viewing this thread

Top Bottom