Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-28-2019, 12:47 PM   #1
Cubsm22p
Newly Registered User
 
Join Date: Feb 2018
Posts: 36
Thanks: 5
Thanked 0 Times in 0 Posts
Cubsm22p is on a distinguished road
Help with tables In a Form

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 by Cubsm22p; 03-28-2019 at 12:57 PM.
Cubsm22p is offline   Reply With Quote
Old 03-28-2019, 12:53 PM   #2
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,914
Thanks: 57
Thanked 1,293 Times in 1,274 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Help with tables In a Form

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)
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
Cubsm22p (03-28-2019)
Old 03-28-2019, 01:11 PM   #3
Cubsm22p
Newly Registered User
 
Join Date: Feb 2018
Posts: 36
Thanks: 5
Thanked 0 Times in 0 Posts
Cubsm22p is on a distinguished road
Re: Help with tables In a Form

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

Cubsm22p is offline   Reply With Quote
Old 03-28-2019, 01:16 PM   #4
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,914
Thanks: 57
Thanked 1,293 Times in 1,274 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Help with tables In a Form

[ContentNum] must be a Text field. If so, try it this way:
Code:
DoCmd.OpenForm "NewErrorfrm", , , "[ContentNum]='" & Me.[ContentNum] & "'"
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by theDBguy; 03-28-2019 at 01:32 PM.
theDBguy is online now   Reply With Quote
Old 03-28-2019, 01:21 PM   #5
Cubsm22p
Newly Registered User
 
Join Date: Feb 2018
Posts: 36
Thanks: 5
Thanked 0 Times in 0 Posts
Cubsm22p is on a distinguished road
Re: Help with tables In a Form

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
Cubsm22p is offline   Reply With Quote
Old 03-28-2019, 01:32 PM   #6
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,914
Thanks: 57
Thanked 1,293 Times in 1,274 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Help with tables In a Form

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
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 03-29-2019, 07:38 AM   #7
Cubsm22p
Newly Registered User
 
Join Date: Feb 2018
Posts: 36
Thanks: 5
Thanked 0 Times in 0 Posts
Cubsm22p is on a distinguished road
Re: Help with tables In a Form

Would I put that in the 'after update event' for the search box,
hhehhe.PNG

Cubsm22p is offline   Reply With Quote
Old 03-29-2019, 07:42 AM   #8
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,914
Thanks: 57
Thanked 1,293 Times in 1,274 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Help with tables In a Form

Quote:
Originally Posted by Cubsm22p View Post
Would I put that in the 'after update event' for the search box,
Attachment 74447
Yes. Try it out and let us know what happens.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 03-29-2019, 07:55 AM   #9
Cubsm22p
Newly Registered User
 
Join Date: Feb 2018
Posts: 36
Thanks: 5
Thanked 0 Times in 0 Posts
Cubsm22p is on a distinguished road
Re: Help with tables In a Form

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
Cubsm22p is offline   Reply With Quote
Old 03-29-2019, 07:57 AM   #10
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,914
Thanks: 57
Thanked 1,293 Times in 1,274 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Help with tables In a Form

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.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 03-29-2019, 08:09 AM   #11
Cubsm22p
Newly Registered User
 
Join Date: Feb 2018
Posts: 36
Thanks: 5
Thanked 0 Times in 0 Posts
Cubsm22p is on a distinguished road
Re: Help with tables In a Form

syntax error when i do it like this:
Me.Trackertbl_subform1.Form.Filter = "[ContentNum]='" & Me.Text2* & "'"
Me.Trackertbl_subform1.Form.FilterOn = True
Cubsm22p is offline   Reply With Quote
Old 03-29-2019, 08:10 AM   #12
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,914
Thanks: 57
Thanked 1,293 Times in 1,274 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Help with tables In a Form

Quote:
Originally Posted by Cubsm22p View Post
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 & "*'"
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
Cubsm22p (03-29-2019)
Old 03-29-2019, 08:17 AM   #13
Cubsm22p
Newly Registered User
 
Join Date: Feb 2018
Posts: 36
Thanks: 5
Thanked 0 Times in 0 Posts
Cubsm22p is on a distinguished road
Re: Help with tables In a Form

That worked!, Lets say I want the search box to filter other other attributes along with the contentNum
Cubsm22p is offline   Reply With Quote
Old 03-29-2019, 08:21 AM   #14
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,914
Thanks: 57
Thanked 1,293 Times in 1,274 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Help with tables In a Form

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 & "*' AND Field2 Like '" & txtSearch & "*'"
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
Cubsm22p (03-29-2019)
Old 03-29-2019, 08:40 AM   #15
Cubsm22p
Newly Registered User
 
Join Date: Feb 2018
Posts: 36
Thanks: 5
Thanked 0 Times in 0 Posts
Cubsm22p is on a distinguished road
Re: Help with tables In a Form

Thank You for all of your help
Attached Images
File Type: png cantgetit.PNG (8.8 KB, 10 views)


Last edited by Cubsm22p; 03-29-2019 at 08:55 AM.
Cubsm22p is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form with 2 tables fernando.rosales Forms 3 06-11-2014 10:35 AM
Updating multiple tables form single form mcdhappy80 Forms 2 09-09-2009 07:09 AM
How to tie two tables in the form? bignan Forms 6 02-13-2009 01:07 PM
Question Editing 2 tables form the same form. SiyBlue General 2 06-16-2008 01:33 AM
One form, two tables kupe Modules & VBA 2 10-28-2003 01:58 AM




All times are GMT -8. The time now is 05:00 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World