Same Subform On Different Tabs - Openargs Help

Aug 31, 2006

Hi
I have a form with some tabs. Each tab has 2 subforms, of which the 2nd subform is always the same (call it SubformB).

I had it set up before so that the SQL query to run is passed in the openargs property to that that form and this works well.

However, on a tabbed form, each tab opens up Subform B as soon as the page is loaded. Is there a way to pass openargs to SubForm B on each of the tabs so that they all run different SQL queries even though they are essentially the same form ?

View Replies


ADVERTISEMENT

Forms :: Getting Same Subform To Update Across Different Tabs

Jul 14, 2015

Update an old database (2005 old) with new employees, jobs, etc.

Unfortunately, the old database had a lot of restrictions, was outdated in what we needed (even had the companies old name), and so forth. So, I decided to build a new one. I am at the very end of this journey and there is one thing that is keeping me from completing it:

When I put in a new employee's name, I do so in my first tab, Employee Data. The subform in this tab is "subEmployees" and it's source is a table called "Employees". My next tab is "Drug Tests" and in it is a subMaster and subChild. The subMaster is "subEmployees". A few more tabs over is "Training History", where again, there is a subMaster and subChild. Again, the subMaster is the form "subEmployees".

I would think that since all of these are the same subform or whatever, they should all update immediately when the other one's are changed. That, however, is not the case. I have to close and reopen (or enter/exit design view) to update information. Once the information is there, however, I can change it freely. I assume this is a problem with "requery" but I don't know how to fix it, as it is obviously refreshing just fine.

I do have code for requery but it came from the previous database (as my major is chemical engineering and I know very little about code) and the code only deals with the subChild of my "Drug Tests" and "Training History" tabs.

View 1 Replies View Related

Forms :: Update Number Value From One Tabbed Subform Across 4 Tabs

Feb 10, 2014

I have an on click event that checks if entered number values on my first tabbed subform are not null. I then pass the values to three other fields each on a different tabbed subform using If Then Else syntax that seems to work. When I click through the tabs after the code has finished I can see the updated values on their respective tabbed subforms. However, when I click back through the tabs or requery the record all but the first and last subform values have saved.

I have tried inserting If Me.Dirty Then Me.Dirty = False in the subform after update and on data change events as well as in the on click event. I have also tried RunCommand acCmdSaveRecord and neither seems to work.

Ex.
If IsNull(Me.AMT1_AF) Then
Else
Forms![SCH_ENTRY]![ENT1subform]![AMT1] = Me.AMT1_AF
End If
If IsNull(Me.AMT2_AF) Then

[Code]...

View 9 Replies View Related

Forms :: Show Tabs And Subforms In Tabs Only If Data Exists

May 6, 2013

I'm trying to clean up a form a bit and have it only show certain subforms/graphs if the data exists. I already have columns in a combobox query to show an "X" for if certain data appears:

Now, I know I could build another query and have some system go through and identify these things, but the easiest thing would be to reference the "X" in the columns of the combobox. Is there an easy way to reference values in the other (non-primary) columns? Or can you think of an easy way to make these subforms only be visible when the data exists? Maybe have an on load event for the subform?

View 2 Replies View Related

OpenArgs?

Feb 21, 2005

I've read about 50 posts regarding passing a value from one form to another, and I Just don't get it!

I have a table of zipcodes which I use to autofill city and state fields. The Zipcode is entered into txtCoZip. If the zipcode is in the table it autofills, but if the zipcode is not in the table, a form opens to add it to the table. OpenArgs seems to be the answer to this, but I can't quite follow it all the way through. This is the code I'm using to open the form:

DoCmd.OpenForm "frmAddZipcode", OpenArgs:=Me.txtCoZip

This is the code I'm using on the onOpen event of frmAddZipcode:


If Not IsNull(Me.OpenArgs) Then
Me.ZipCode = Me.OpenArgs
End If

I'm getting an error "you cannot assign a value to this object'.
What am I doing wrong?

Thanks,
Sup

View 3 Replies View Related

OpenArgs Always Null Value

Nov 6, 2007

Hi Guys,

I have 2 form (Form1) is a log-in form, (Form2) is the Data Entry. After Authenticating the user on Form1 I used DoCmd.OpenForm "MyFormName", , , , , , varUserName, then open Form2 with following code on OnOpen event:

If Not IsNull(Me.OpenArgs) Then
Me.txtUser.Value = Me.OpenArgs
Me.Requery
Else
MsgBox ("Null")
End If

but it always shows the msgBox "Null"

What seems to be the problem with this?

Thanks in advance.

Jeff

View 3 Replies View Related

Refreshing OpenArgs?

May 16, 2005

Hi all,
I have a form (sub_Main) that opens and has an openargs value (Department) from my main form when user clicks on a cmd button. However, if I were to go back to my main form and click on another department the openargs value is not passed along. I have tried using Me.Refresh under LostFocus but it doesnt seem to work.

What is causing the openargs value from updating? Any help?

Thanks!

View 5 Replies View Related

Openargs Problem

Jun 22, 2005

Why do I get and error with this code? It says the openargs is null when I run it

Private Sub TXT_SALESMAN_NUMBER_DblClick(Cancel As Integer)
Dim StCustNumber As String

StCustNumber = Me.TXT_SALESMAN_NUMBER.Text
DoCmd.OpenForm "Frm_Slm_Name", acNormal, , , , , StCustNumber
End Sub


Private Sub Form_Open(Cancel As Integer)
Dim StCustNumberSub As String


StCustNumberSub = Forms![frm_slm_name].OpenArgs
DoCmd.GoToControl "Salesnumber"
DoCmd.FindRecord StCustNumberSub, , True, , True, , True

End Sub



Thanks
Andy

View 4 Replies View Related

OpenArgs Problem

Aug 27, 2005

I have a calling form with the following code

Dim strTbl As String
Dim strTitle As String
Dim strSQL As String

strTbl = Me.cboRep.Column(0)
strTitle = Me.cboRep.Column(1)
strSQL = "SELECT tblSupp.SuppName, tblCurr.CurrName, * " _
& "FROM tblCurr INNER JOIN (" & strTbl & " INNER JOIN tblSupp " _
& "ON " & strTbl & ".SuppID = tblSupp.SuppID) " _
& "ON tblCurr.CurrID = " & strTbl & ".CurrID;"

DoCmd.OpenReport "rptList", acViewPreview, , , , strSQL & "," & strTitle

On the Report's OnOpen Event I have

Dim strStr1 As String
strStr1 = Left(Me.OpenArgs, InStr(Me.OpenArgs, ",") - 1)
Me.RecordSource = strStr1

And on the Report's On Activate Event I have

Dim strStr2 As String
strStr2 = Mid(Me.OpenArgs, InStr(Me.OpenArgs, ",") + 1)
Me.txtTitle = strStr2

This should work but it doesn't. The error states that the SQL statement
was not found. Of course, without the second concatenated argument
and Me.RecordSouce = Me.openArgs everything works fine.
Can anybody see where I have gone wrong

Thanks

View 5 Replies View Related

OpenArgs, Two Parameters

Oct 30, 2006

I have used the OpenArgs method to pass a parameter to another form, but I now need to psss two parameters, and I am not sure how to do this.

On Error GoTo Err_CmdOpenForm_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmName"
DoCmd.OpenForm stDocName, , , , , , Me.Text0 'need to pass another
'Parameter Me.Text1
Exit_CmdOpenForm_Click:
Exit Sub

Err_CmdOpenForm_Click:
MsgBox Err.Description
Resume Exit_CmdOpenForm_Click

And on the Load event of frmName, Me.Text1 = Me.OpenArgs 'and Me.Text2

View 5 Replies View Related

OpenArgs Problem

Sep 9, 2004

I'm making a DB for invoices.

I'm trying to make it so that an item can be returned by clicking a command button (cmdReturn) and a form (Returns) will be brought up with the ItemID field already filled in. I'm trying to use OpenArgs but am having problems. At the moment i've got

In the command button:

Private Sub cmdReturn_Click()
Dim varItemID As Integer
Me.Refresh
varItemID = Me.txtItemID
If Not IsNull(varItemID) Then
DoCmd.OpenForm "Returns", , , , , , varItemID
Else
MsgBox "No valid item to return", , "Error"
End If
End Sub

And in the Open Event of the Returns form:

Private Sub Form_Open(Cancel As Integer)
Dim varDCount As Integer, varOpenArgs As Integer
varOpenArgs = Me.OpenArgs
varDCount = DCount("ItemID", "Returns", "[ItemID]= 'varOpenArgs'")
If varDCount = 1 Then
DoCmd.GoToControl (Me.txtItemID)
DoCmd.FindRecord varOpenArgs, , , , , acCurrent
Else
DoCmd.GoToRecord , , acNewRec
ItemID = varOpenArgs
End If
End Sub

I'm getting this error message:
"Run-time error '94':
Invalid use of Null"

And the line in bold above is highlighted with the mouse over message saying "Me.OpenArgs=Null"

If an item already has a Return entry, I want it to go to that entry instead of making a new one. ItemID is the primary key in both tables, linked in a ONE TO ONE relationship.

Any help is appreciated, please ask questions if something's not clear.
Joe

View 3 Replies View Related

Modules & VBA :: Send OpenArgs As Array?

Apr 28, 2015

Is it possible to send several form's OpnArg as Array ? Now I'm using a long text string including || as divider so I can split them later into Array.

View 8 Replies View Related

OpenArgs And Find Record Combination

Dec 9, 2014

The access website says there is a way to use the open arg in combination with the FindRecord method to open a form up to a specified client name. I'm trying to have a macro that asks the user what student they are looking for and then takes them to the form with that name. The reason I can't use a query or something else is because I have macros on the form page that I want them to have access to.

So my question is this.

What's the best way to make a macro that will
1) ask the user for a name input
2) open an already made form
3) take them to a specific record based on the input name

I tried to use something with InputBox and DoCMD.OpenForm but I'm running face first into a wall any time I tried to combine the two.

View 7 Replies View Related

Public Variables, OpenArgs And Compatability Issues

Aug 10, 2005

Hi all,
I seem to have encountered a strange problem at work.

I declared a public variable for user department. The user selects his department from a Log On form and if the password is correct, he opens another form with the department variable passed on in openargs.

All of this works fine in access2k but upon testing with 2003, the openargs somehow do not seem to be being passed on. Maybe I am being dense somewhere but it is kinda puzzling for me.

I am not using access's security for users and groups because I am trying to reduce the complexity of the whole project (I wont be around to maintain it next time).

Any help rendered is greatly appreciated!

View 2 Replies View Related

Error 2001 Problem With OpenArgs And Filter

Jan 12, 2006

Ok heres the situation, Ive had to edit a piece of code that worked fine filtering but wouldnt allow me to refresh a subform on the main search form. Now im using OpenArgs to pass the Selected bike ID to a popup form. This bike ID should then be used to filter the pop up form. But i get error 2001 (You cancelled the previous operation) when the code is run.
The Code follows:

Private Sub cmdSell_Click()

Dim stDocName As String
Dim stLinkCriteria As String


stDocName = "frmSubSell"


DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog, Me.frmSubBikes!BikeID

Me!frmSubBikes.Form.Requery




Private Sub Form_Open(Cancel As Integer)
Dim SearchStr2 As String
SearchStr2 = "[BikeID]= " & Chr$(34) & Me.OpenArgs & Chr$(34)
Me.Filter = SearchStr2
Me.FilterOn = True

End Sub



Thanks, Sci

View 5 Replies View Related

Forms :: Populate Form Control With OpenArgs

Sep 19, 2014

I have this code in a button on my Patient Form:

Code:
DoCmd.OpenForm "frm_Admissions", acNormal, , , acFormAdd, , "NHS Number|" & Me.[NHS Number]

And this in my Admissions form LoadEvent:

Code:
Private Sub Form_Load()
'Use this version if the ID is a number
Dim x As Variant

[Code]....

The expression you entered refers to an object that is closed or doesn't exist

Borrowed code from: [URL]

View 5 Replies View Related

Tabs

Apr 19, 2007

hi iam new to this forum this is my first post , i'am trying to design a student database and i have designed it just want to know how to add different tabs to the view and how to add button/pull down menus to that certain tab when i try to add buttons the go ontop every tab and i can't figure out how to rectefy this any help is app , if you dont know what i'am on about let me know and i will email the database to you and you can see what i mean , thanks ccbup4it

View 4 Replies View Related

Tabs

May 8, 2006

Hi Gurus - is it possible to have a Tab form within aTab form, i tried it with Access 2000 cannot seem to get it right

arrh

View 1 Replies View Related

Problem With Using Tabs

Apr 22, 2006

Hi - Could anyone please help me.
I have got a form on which I am using tabs. For some reason, when that form is opened, it is not showing the full number of records from the table. It is only opening in Add mode. If I then start to enter multiple records the navigation buttons at the bottom of the screen will show me how many records I have entered and you can use the navigation buttons to switch between them, however, if I think close the form and re-open it, it goes back to showing no records.

I have tried opening it in Add mode and in Show All mode, but neither is working.

The Cycle property is showing "all records" and the data is definately being stored in teh Source table.

Any help will be gratefully received.

View 1 Replies View Related

Problem With Using Tabs

Apr 22, 2006

Hi - Could anyone please help me.
I have got a form on which I am using tabs. For some reason, when that form is opened, it is not showing the full number of records from the table. It is only opening in Add mode. If I then start to enter multiple records the navigation buttons at the bottom of the screen will show me how many records I have entered and you can use the navigation buttons to switch between them, however, if I think close the form and re-open it, it goes back to showing no records.

I have tried opening it in Add mode and in Show All mode, but neither is working.

The Cycle property is showing "all records" and the data is definately being stored in teh Source table.

Any help will be gratefully received.

View 2 Replies View Related

Taskbar Tabs

Feb 11, 2006

Is there a way to make it so when you open a database the forms, tables, etc do not appear in the taskbar and just appear in the bottem right of access.

So basically, like already but without the taskbar tabs.

Thanks

View 2 Replies View Related

Of Tabs And Checkboxes

Mar 15, 2008

Let me just start off by saying, I don't have any code to post as it is just an idea I have.

This is a Lease return project for work. We have an excel sheet that is broken up into tabs. Master List, Not Returned and then a tab for every month.

Here is what I would like to do.
If someone checks the box that says the leased computer was not returned, can I grab a certain batch of fields to automatically populate another Tab in this Access 2003 Form?

The second part to this would be if a person unchecks "Not Returned" in the Not Returned Tab, can I get that record automatically removed from that list view?

Similar principle for the Monthly shipping by a certain date. If the user enters in a shipped Date by say March 1, is there any way to populate a another tab into a list view?

Thanks for any advice that you gentlemen and ladies can provide.

View 14 Replies View Related

Tabs Control Help

Jan 25, 2005

i have one form with 4tabs with name frmMain and one button open form frm1.

if i close frm1 i want open frmMain to 2tab

can i do this?


thanks :p :p :p :p :p

View 1 Replies View Related

Adding Tabs

Sep 14, 2005

i have a database that stores contractors/owners & the 4 types of city permits we will be issuing.
i have created a form w/the wizard which contains all the info that i need the users to enter, however all info will not always be necessary. i would like to create a main tab with general permit information for users to enter (this is always necessary), and then 4 other tabs for which specifics may be entered dependng on which permit we will be issuing (at least 1, but up to 4 of these will be necessary). I would like 5 tabs...1 for main info, and the other 4 for specifics. i tried doing this manually in design view but for some reason i am unable to enter any data. :confused: does anyone know of a quick way to separate the fields that already exist on the form created by the wizard onto separate tabs??? thanx in advance! :)

View 1 Replies View Related

Tabs Going To Next Record!!!

Sep 25, 2005

Why does my form go to the next record when I reach the end of my tab sequence. And who does one get rid of the controls in the tab list. I had controls on there at one time, but now I dont and the control names are still in the list. But my biggest problem is why its going to the next record!

View 1 Replies View Related

Excel Tabs

Dec 9, 2005

hi

is there a way to display an excel looking sheet into a form which displays different tabs for each query that i want to output

or is it easier to just output the data to excel into different tabs??


thanks

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved