Help with tables In a Form

Cubsm22p

Registered User.
Local time
Yesterday, 16:30
Joined
Feb 14, 2018
Messages
37
frmhelp.PNG

I would like to be able to click on these sub form records and have it open up a Editing_record form with the record that was clicked showing.

Editing_record form:formhelp2.PNG
 
Last edited:
Hi. You should be able to use the OpenForm method and simply pass the ID of the clicked record in the WhereCondition argument as a filter criteria. For example:
Code:
DoCmd.OpenForm "FormName", , , "[ID]=" & Nz(Me.ID,0)
 
like this:
example2.jpg

update got this error with that:
errer.PNG

Got it with this:
DoCmd.OpenForm "NewErrorfrm", acNormal, , "[ContentNum] = '" & Me![ContentNum] & "'"

Thanks for the help
 
[ContentNum] must be a Text field. If so, try it this way:
Code:
DoCmd.OpenForm "NewErrorfrm", , , "[ContentNum]='" & Me.[ContentNum] & "'"
 
Last edited:
Now i would like to use this search button to put what ever i search on top of the list in the table.
helpagain.PNG
 
Hi. Not sure what you mean but assuming you want to search for a ContentNum, then you could try:
Code:
Me.Filter="[ContentNum]='" & Me.Searchbox & "'"
Me.FilterOn=False
 
Would I put that in the 'after update event' for the search box,
hhehhe.PNG
 
I put this in the 'after click update' on the search button and it worked:

Me.Trackertbl_subform1.Form.Filter = "[ContentNum]='" & Me.Text2 & "'"
Me.Trackertbl_subform1.Form.FilterOn = True

but how would i do it if i wanted it to make LIKE not just =
this didnt work:
Me.Trackertbl_subform1.Form.Filter = "[ContentNum]LIKE'" & Me.Text2 & "'"
Me.Trackertbl_subform1.Form.FilterOn = True
 
Try adding a space between the field name and Like operator. Also, if you want to use Like, you probably want to use wildcards as well.
 
syntax error when i do it like this:
Me.Trackertbl_subform1.Form.Filter = "[ContentNum]='" & Me.Text2* & "'"
Me.Trackertbl_subform1.Form.FilterOn = True
 
syntax error when i do it like this:
Me.Trackertbl_subform1.Form.Filter = "[ContentNum]='" & Me.Text2* & "'"
Me.Trackertbl_subform1.Form.FilterOn = True
Try it this way:
Code:
Me.Trackertbl_subform1.Form.Filter = "[ContentNum] Like '" & Me.Text2 & "*'"
 
That worked!, Lets say I want the search box to filter other other attributes along with the contentNum
 
If you want all conditions to match, you'll use AND. If you only care as long as any of them matches, then you'll use OR. For example:
Code:
"Field1 Like '" & txtSearch & "*' [b]AND[/b] Field2 Like '" & txtSearch & "*'"
 
Thank You for all of your help
 

Attachments

  • cantgetit.PNG
    cantgetit.PNG
    8.8 KB · Views: 113
Last edited:
Hi. Format is different from data type. Go back to the table's design and make sure the field's data type is any of the following: Double, Single, or Currency
 
This should explain why:
Precision is the number of digits in a number. Scale is the number of digits to the right of the decimal point in a number.
For example, the number 123.45 has a precision of 5 and a scale of 2.

You have set scale=0 so you get whole numbers only
You would probably be much better off using Single or Double number datatype depending on the size of your numbers
 

Users who are viewing this thread

Back
Top Bottom