Solved OpenArgs Select Case Form Conditions! (1 Viewer)

ahmad_rmh

Member
Local time
Today, 19:01
Joined
Jun 26, 2022
Messages
243
My form is opening with three select case conditions, "Receipt, Transfer and Adjustment".

At the time of transfer, If the stock balance of any item is null then the quantity field should have to be disabled for data entry and should have to show a message. These fields are available on the subform. I have tried but not getting the results.

Your precious suggestions are required please.
 

Attachments

  • 90584-e031e246fbc177357cfb98b48f92d987.gif
    90584-e031e246fbc177357cfb98b48f92d987.gif
    6.2 KB · Views: 75

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:01
Joined
Jul 9, 2003
Messages
16,244
My form is opening with three select case conditions, "Receipt, Transfer and Adjustment".

At the time of transfer, If the stock balance of any item is null then the quantity field should have to be disabled for data entry and should have to show a message. These fields are available on the subform. I have tried but not getting the results.

Your precious suggestions are required please.

The image is too small. You're asking me to guess at the answer you want me to provide. Please provide a better explanation of the issue.
 

ahmad_rmh

Member
Local time
Today, 19:01
Joined
Jun 26, 2022
Messages
243
I am making warehouse inventory project.

**(Currently the image is not available.)**

So, explaining without image.

Main Form Name: frmTransactionsMain
Sub Form Namr: frmTransactions Sub

Sub Form Fields:

Items, Quantity, PackingSize, QOH (DSum value coming from query)

I am using the following code on the main form at the time of opening.

Code:
Select Case Me.OpenArgs
        Case "Receipt"
            With Me
                .lbleceipt.Visible = True
                .lblTransfer.Visible = False
                .lblAdjustment.Visible = False
                .EntityFK.Visible = False
                .EntityFK_Label.Visible = False
                .VendorsFK.Visile = True
                .VendorsFK_Label.Visible = True
                .TranTypeFK.RowSource = "SELECT TranTypePK, TranType from tblTranTypes WHERE TranTypePK<=2"
                .TranTypeFK.ColumnCount = 2
                .TranTypeFK.ColumnWidths = "0;1cm"
                .TranTypeFK.DefaultValue = 1
            End With
           
        Case "Transfer"
            With Me
                .lblReceipt.Visible = False
                .lblTransfer.Visible = True
                .lblAdjustment.Visible = False
                .EntityFK.Visible = True
                .EntityFK_Label.Visible = True
                .VendorsFK.Visible =  False
                .VendorsFK_Label.Visible = False
                .TranTypeFK.RowSource = "SELECT TranTypePK, TranType from tblTranTypes WHERE TranTypePK>=3"
                .TranTypeFK.ColumnCount = 2
                .TranTypeFK.ColumnWidths = "0;1cm"
                .TranTypeFK.DefaultValue = 3
            End With

I want to make two conditions after update event in "items" field on subform.

1st condition: it will check after update of "Items" which case statement is open in mainform, if the case statement is "Transfer" then it will apply a 2nd condition.

2nd condition: after update event "items", if the quantity on hand is zero or null then pop up a message and disable the data entry in quantity field.

I don't know how to implement these conditions.

Kindly suggest.
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:01
Joined
Jul 9, 2003
Messages
16,244
Well unless I'm missing something I don't think the title of your post is correct. You have it working, the openargs is opening the correct part of the select case? Or Not?
 

ahmad_rmh

Member
Local time
Today, 19:01
Joined
Jun 26, 2022
Messages
243
Every thing is working normally. There is no error.

I want to make after update event on items in subform in transfer case as the form is only one for data entry with all three cases.

How i will get that in transfer case.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:01
Joined
Jul 9, 2003
Messages
16,244
in Transfer case that if the item selected quantity is not available in the store then the quantity field should have to be disabled and the message should have to pop up.

I'm not at all clear on what you want. I think what you are saying is that when an item is selected, if there isn't any stock, then the user should not be able to select a quantity?
 

ahmad_rmh

Member
Local time
Today, 19:01
Joined
Jun 26, 2022
Messages
243
I'm not at all clear on what you want. I think what you are saying is that when an item is selected, if there isn't any stock, then the user should not be able to select a quantity?

Yes right,
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:01
Joined
Jul 9, 2003
Messages
16,244
I'm assuming that your items are selected from a combobox. I suggest you base the combo box on a query that counts the number of items available.

If the items are not available then do not show the items in the combo box.
 
Last edited:

ahmad_rmh

Member
Local time
Today, 19:01
Joined
Jun 26, 2022
Messages
243
I'm assuming that your items are selected from a combobox. I suggest you base the combo box on a query that counts the number of items available.

If the items are not available then do not show the items in the combo box.

A good sense of humour :mad:
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:01
Joined
Jul 9, 2003
Messages
16,244
A good sense of humour :mad:

Really? I have quite a good humour which is why I will not immediately ban you... (Now that's humour!)

You see, your problem is your question is vague and difficult to interpret. I'm doing my best, however I'm not grasping what you want. You are not helping in responding in an un-helpful manner.

A better response would have been, no that's not going to work because.... Then I, and hopefully others here will feedback with comments and eventually we will end up with a solution that works for you.

But to be honest if you don't buck-up, if you don't put a bit of effort into your responses, if you don't respond in a way to help the people who are trying to help you, then you're not going to make much progress....

I am now going to find a thread where someone has been able to post a question which is understandable and try and help them. I'll return to your thread once I note that you are putting more effort in...
 

ahmad_rmh

Member
Local time
Today, 19:01
Joined
Jun 26, 2022
Messages
243
I haven't tried that way,

I was trying to solve through VBA coding because I have only one form to receive inventory, transfer of inventory, etc with six transactions types.

And every transaction type have a link on dashboard with different scenarios but basically at the backend only one table and at the front one form opening with different scenarios.

As I had already told my form is opening through select case statements if one is visible to true the others visibility false.

So, i have solved through applying Nested If statements.

On the other hand, as you suggested, if you are receiving items with zero stock then this was not possible to see those items as you had filtered through a query as only one table for all scenarios to work.

Anyhow, I apologise on my words. I know you are most experienced and professional and I am just a beginner.
 

Users who are viewing this thread

Top Bottom